File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 9
9
import pytest
10
10
11
11
import pytensor
12
+ from pytensor import config
12
13
from pytensor .compile .mode import get_mode
13
14
from pytensor .compile .ops import deep_copy_op
14
15
from pytensor .printing import (
@@ -464,8 +465,10 @@ def test_Print(capsys):
464
465
assert "hello" in stdout
465
466
466
467
467
- def test_summary ():
468
- old_profile_optimizer_config_value = pytensor .config .profile_optimizer = True
469
- f = pytensor .function (inputs = [], outputs = [], profile = True )
470
- f .profile .summary ()
471
- pytensor .config .profile_optimizer = old_profile_optimizer_config_value
468
+ def test_summary_with_profile_optimizer ():
469
+ with config .change_flags (profile_optimizer = True ):
470
+ f = pytensor .function (inputs = [], outputs = [], profile = True )
471
+
472
+ s = StringIO ()
473
+ f .profile .summary (file = s )
474
+ assert "Rewriter Profile" in s .getvalue ()
You can’t perform that action at this time.
0 commit comments