Issue #22390: Remove files created by tests

This commit is contained in:
Victor Stinner 2014-10-05 17:37:41 +02:00
parent 8f437aac06
commit 047b7ae566
7 changed files with 10 additions and 3 deletions

View file

@ -13,7 +13,8 @@ import time
import shutil
import unittest
from test.support import (
verbose, import_module, run_unittest, TESTFN, reap_threads, forget, unlink)
verbose, import_module, run_unittest, TESTFN, reap_threads,
forget, unlink, rmtree)
threading = import_module('threading')
def task(N, done, done_tasks, errors):
@ -222,6 +223,7 @@ class ThreadedImportTests(unittest.TestCase):
f.write(code.encode('utf-8'))
self.addCleanup(unlink, filename)
self.addCleanup(forget, TESTFN)
self.addCleanup(rmtree, '__pycache__')
importlib.invalidate_caches()
__import__(TESTFN)