Hack to avoid test_tempfile failures when run after test_threaded_import

(only needed on 3.1)
This commit is contained in:
Antoine Pitrou 2010-11-15 18:25:24 +00:00
parent 3a72b250eb
commit 069488d279
1 changed files with 4 additions and 0 deletions

View File

@ -10,6 +10,10 @@ import imp
import sys
import time
import shutil
# HACK: preloading tempfile is necessary to avoid failures when test_tempfile
# is run after test_threaded_import. This has to do with dark secrets of
# the import machinery and phantom copies of the random module.
import tempfile
import unittest
from test.support import verbose, import_module, run_unittest, TESTFN
thread = import_module('_thread')