diff options
author | Hai Shi <shihai1992@gmail.com> | 2020-05-27 22:10:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 22:10:27 (GMT) |
commit | e80697d687b610bd7fb9104af905dec8f0bc55a7 (patch) | |
tree | c848b98eaec2d959237fda725cf47b059f34b12a /Lib/test/test_io.py | |
parent | 7d80b35af1ee03834ae4af83e920dee89c2bc273 (diff) | |
download | cpython-e80697d687b610bd7fb9104af905dec8f0bc55a7.zip cpython-e80697d687b610bd7fb9104af905dec8f0bc55a7.tar.gz cpython-e80697d687b610bd7fb9104af905dec8f0bc55a7.tar.bz2 |
bpo-40275: Adding threading_helper submodule in test.support (GH-20263)
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index fe07b56..7b8511b 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -40,6 +40,7 @@ from itertools import cycle, count from test import support from test.support.script_helper import ( assert_python_ok, assert_python_failure, run_python_until_end) +from test.support import threading_helper from test.support import FakePath import codecs @@ -1472,7 +1473,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): errors.append(e) raise threads = [threading.Thread(target=f) for x in range(20)] - with support.start_threads(threads): + with threading_helper.start_threads(threads): time.sleep(0.02) # yield self.assertFalse(errors, "the following exceptions were caught: %r" % errors) @@ -1836,7 +1837,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests): errors.append(e) raise threads = [threading.Thread(target=f) for x in range(20)] - with support.start_threads(threads): + with threading_helper.start_threads(threads): time.sleep(0.02) # yield self.assertFalse(errors, "the following exceptions were caught: %r" % errors) @@ -3270,7 +3271,7 @@ class TextIOWrapperTest(unittest.TestCase): f.write(text) threads = [threading.Thread(target=run, args=(x,)) for x in range(20)] - with support.start_threads(threads, event.set): + with threading_helper.start_threads(threads, event.set): time.sleep(0.02) with self.open(support.TESTFN) as f: content = f.read() |