diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-09 15:04:27 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-09 15:04:27 (GMT) |
commit | 87cf220972c9cb400ddcd577962883dcc5dca51a (patch) | |
tree | 3f1ab5b64ae538a2ced622637cc7e4112b1c6ffd /Lib/test/test_multiprocessing.py | |
parent | df77e3d4a07223ebfe049e66d4d8a8c0b4315e04 (diff) | |
download | cpython-87cf220972c9cb400ddcd577962883dcc5dca51a.zip cpython-87cf220972c9cb400ddcd577962883dcc5dca51a.tar.gz cpython-87cf220972c9cb400ddcd577962883dcc5dca51a.tar.bz2 |
Issue #11743: Rewrite multiprocessing connection classes in pure Python.
Diffstat (limited to 'Lib/test/test_multiprocessing.py')
-rw-r--r-- | Lib/test/test_multiprocessing.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py index a7f0391..0c05ff6 100644 --- a/Lib/test/test_multiprocessing.py +++ b/Lib/test/test_multiprocessing.py @@ -1915,9 +1915,15 @@ class TestInvalidHandle(unittest.TestCase): @unittest.skipIf(WIN32, "skipped on Windows") def test_invalid_handles(self): - conn = _multiprocessing.Connection(44977608) - self.assertRaises(IOError, conn.poll) - self.assertRaises(IOError, _multiprocessing.Connection, -1) + conn = multiprocessing.connection.Connection(44977608) + try: + self.assertRaises((ValueError, IOError), conn.poll) + finally: + # Hack private attribute _handle to avoid printing an error + # in conn.__del__ + conn._handle = None + self.assertRaises((ValueError, IOError), + multiprocessing.connection.Connection, -1) # # Functions used to create test cases from the base ones in this module |