Commit 07edb82e authored by Antoine Pitrou's avatar Antoine Pitrou

Call importlib.invalidate_caches() after creating module files in test_threaded_import.

parent e0b1c231
......@@ -7,6 +7,7 @@
import os
import imp
import importlib
import sys
import time
import shutil
......@@ -190,6 +191,7 @@ class ThreadedImportTests(unittest.TestCase):
f.write(contents.encode('utf-8'))
self.addCleanup(forget, name)
importlib.invalidate_caches()
results = []
def import_ab():
import A
......@@ -220,6 +222,7 @@ class ThreadedImportTests(unittest.TestCase):
f.write(code.encode('utf-8'))
self.addCleanup(unlink, filename)
self.addCleanup(forget, TESTFN)
importlib.invalidate_caches()
__import__(TESTFN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment