summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imp.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2013-08-19 21:31:18 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2013-08-19 21:31:18 (GMT)
commitbb2c45e7a4101d106bf776cf7217d2f1531e8002 (patch)
treeb919262b92fb046272a12e105072cc6c065318da /Lib/test/test_imp.py
parent228c194596b8e357ae586a76ee392740107bd663 (diff)
downloadcpython-bb2c45e7a4101d106bf776cf7217d2f1531e8002.zip
cpython-bb2c45e7a4101d106bf776cf7217d2f1531e8002.tar.gz
cpython-bb2c45e7a4101d106bf776cf7217d2f1531e8002.tar.bz2
Issue #7732: try to fix test_bug7732's flakiness on Windows by executing it in a fresh temporary directory.
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r--Lib/test/test_imp.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index d324191..8eb56f6 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -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):