summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 3e61577..7089328 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -785,11 +785,13 @@ class ImportTracebackTests(unittest.TestCase):
sys.path[:] = self.old_path
rmtree(TESTFN)
- def create_module(self, mod, contents):
- with open(os.path.join(TESTFN, mod + ".py"), "w") as f:
+ def create_module(self, mod, contents, ext=".py"):
+ fname = os.path.join(TESTFN, mod + ext)
+ with open(fname, "w") as f:
f.write(contents)
self.addCleanup(unload, mod)
importlib.invalidate_caches()
+ return fname
def assert_traceback(self, tb, files):
deduped_files = []