File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -227,7 +227,8 @@ class PyCompileCLITestCase(unittest.TestCase):
227227 def setUp (self ):
8000
228228 self .directory = tempfile .mkdtemp ()
229229 self .source_path = os .path .join (self .directory , '_test.py' )
230- self .cache_path = importlib .util .cache_from_source (self .source_path )
230+ self .cache_path = importlib .util .cache_from_source (self .source_path ,
231+ optimization = '' if __debug__ else 1 )
231232 with open (self .source_path , 'w' ) as file :
232233 file .write ('x = 123\n ' )
233234
@@ -250,6 +251,7 @@ def pycompilecmd_failure(self, *args):
250251 return script_helper .assert_python_failure ('-m' , 'py_compile' , * args )
251252
252253 def test_stdin (self ):
254+ self .assertFalse (os .path .exists (self .cache_path ))
253255 result = self .pycompilecmd ('-' , input = self .source_path )
254256 self .assertEqual (result .returncode , 0 )
255257 self .assertEqual (result .stdout , b'' )
You can’t perform that action at this time.
0 commit comments