mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #7732: try to fix test_bug7732's flakiness on Windows by executing it in a fresh temporary directory.
This commit is contained in:
parent
228c194596
commit
bb2c45e7a4
1 changed files with 3 additions and 5 deletions
|
@ -278,13 +278,11 @@ class ImportTests(unittest.TestCase):
|
|||
@unittest.skipIf(sys.dont_write_bytecode,
|
||||
"test meaningful only when writing bytecode")
|
||||
def test_bug7732(self):
|
||||
source = support.TESTFN + '.py'
|
||||
os.mkdir(source)
|
||||
try:
|
||||
with support.temp_cwd():
|
||||
source = support.TESTFN + '.py'
|
||||
os.mkdir(source)
|
||||
self.assertRaisesRegex(ImportError, '^No module',
|
||||
imp.find_module, support.TESTFN, ["."])
|
||||
finally:
|
||||
os.rmdir(source)
|
||||
|
||||
|
||||
class ReloadTests(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue