#9964: fix running test_import under -O or -OO.

This commit is contained in:
Georg Brandl 2010-10-14 07:24:28 +00:00
parent ebbf63b5b2
commit fb3c84a8d9

View file

@ -520,7 +520,8 @@ def test_import_pyc_path(self):
__import__(TESTFN)
self.assertTrue(os.path.exists('__pycache__'))
self.assertTrue(os.path.exists(os.path.join(
'__pycache__', '{}.{}.pyc'.format(TESTFN, self.tag))))
'__pycache__', '{}.{}.py{}'.format(
TESTFN, self.tag, sys.flags.optimize and 'o' or 'c'))))
@unittest.skipUnless(os.name == 'posix',
"test meaningful only on posix systems")