diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-06-22 19:25:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 19:25:44 +0200 |
commit | 8fbbdf0c3107c3052659e166f73990b466eacbb0 (patch) | |
tree | 81ce7da212017b7918b2373dc68a50cb9fda52fc /Lib/test/_test_multiprocessing.py | |
parent | 209abf746985526bce255e2fba97d3246924885d (diff) | |
download | cpython-git-8fbbdf0c3107c3052659e166f73990b466eacbb0.tar.gz |
bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)
* Add support.MS_WINDOWS: True if Python is running on Microsoft Windows.
* Add support.MACOS: True if Python is running on Apple macOS.
* Replace support.is_android with support.ANDROID
* Replace support.is_jython with support.JYTHON
* Cleanup code to initialize unix_shell
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 31eadd24d3..b202aa2089 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -103,8 +103,6 @@ else: HAVE_GETVALUE = not getattr(_multiprocessing, 'HAVE_BROKEN_SEM_GETVALUE', False) -WIN32 = (sys.platform == "win32") - from multiprocessing.connection import wait def wait_for_handle(handle, timeout): @@ -3806,7 +3804,7 @@ class _TestPollEintr(BaseTestCase): class TestInvalidHandle(unittest.TestCase): - @unittest.skipIf(WIN32, "skipped on Windows") + @unittest.skipIf(support.MS_WINDOWS, "skipped on Windows") def test_invalid_handles(self): conn = multiprocessing.connection.Connection(44977608) # check that poll() doesn't crash @@ -4134,12 +4132,12 @@ class TestWait(unittest.TestCase): class TestInvalidFamily(unittest.TestCase): - @unittest.skipIf(WIN32, "skipped on Windows") + @unittest.skipIf(support.MS_WINDOWS, "skipped on Windows") def test_invalid_family(self): with self.assertRaises(ValueError): multiprocessing.connection.Listener(r'\\.\test') - @unittest.skipUnless(WIN32, "skipped on non-Windows platforms") + @unittest.skipUnless(support.MS_WINDOWS, "skipped on non-Windows platforms") def test_invalid_family_win32(self): with self.assertRaises(ValueError): multiprocessing.connection.Listener('/var/test.pipe') @@ -4265,7 +4263,7 @@ class TestForkAwareThreadLock(unittest.TestCase): class TestCloseFds(unittest.TestCase): def get_high_socket_fd(self): - if WIN32: + if support.MS_WINDOWS: # The child process will not have any socket handles, so # calling socket.fromfd() should produce WSAENOTSOCK even # if there is a handle of the same number. @@ -4283,7 +4281,7 @@ class TestCloseFds(unittest.TestCase): return fd def close(self, fd): - if WIN32: + if support.MS_WINDOWS: socket.socket(socket.AF_INET, socket.SOCK_STREAM, fileno=fd).close() else: os.close(fd) |