Correct a failing test when test_import is run after test_coding:

be sure to import a fresh module by removing it from sys.modules
This commit is contained in:
Amaury Forgeot d'Arc 2007-11-16 00:56:23 +00:00
parent cf171a7fbc
commit dd9e3b8736
2 changed files with 9 additions and 4 deletions

View file

@ -54,6 +54,8 @@ class ImportTest(unittest.TestCase):
print("b =", b, file=f)
f.close()
if TESTFN in sys.modules:
del sys.modules[TESTFN]
try:
try:
mod = __import__(TESTFN)