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):
227
227
def setUp (self ):
228
228
self .directory = tempfile .mkdtemp ()
229
229
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 )
231
232
with open (self .source_path , 'w' ) as file :
232
233
file .write ('x = 123\n ' )
233
234
@@ -249,6 +250,7 @@ def pycompilecmd_failure(self, *args):
249
250
return script_helper .assert_python_failure ('-m' , 'py_compile' , * args )
250
251
251
252
def test_stdin (self ):
253
+ self .assertFalse (os .path .exists (self .cache_path ))
252
254
result = self .pycompilecmd ('-' , input = self .source_path )
253
255
self .assertEqual (result .returncode , 0 )
254
256
self .assertEqual (result .stdout , b'' )
You can’t perform that action at this time.
0 commit comments