]> granicus.if.org Git - python/commitdiff
FIX failure on OSX sem_getvalue (GH-6180) (GH-6181)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 21 Mar 2018 19:00:55 +0000 (12:00 -0700)
committerAntoine Pitrou <pitrou@free.fr>
Wed, 21 Mar 2018 19:00:55 +0000 (20:00 +0100)
(cherry picked from commit dec1c7786f642049c2508e909442189dc043b5da)

Co-authored-by: Thomas Moreau <thomas.moreau.2010@gmail.com>
Lib/test/_test_multiprocessing.py
Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst [new file with mode: 0644]

index c787702f1d4c89d209f398331b770d763aa29fc2..c6a1f5ca905111c412a650fa0984f34f53b94164 100644 (file)
@@ -1062,11 +1062,16 @@ class _TestQueue(BaseTestCase):
             q = self.Queue(maxsize=1)
             q.put(NotSerializable())
             q.put(True)
-            self.assertEqual(q.qsize(), 1)
+            try:
+                self.assertEqual(q.qsize(), 1)
+            except NotImplementedError:
+                # qsize is not available on all platform as it
+                # relies on sem_getvalue
+                pass
             # bpo-30595: use a timeout of 1 second for slow buildbots
             self.assertTrue(q.get(timeout=1.0))
             # Check that the size of the queue is correct
-            self.assertEqual(q.qsize(), 0)
+            self.assertTrue(q.empty())
             close_queue(q)
 
     def test_queue_feeder_on_queue_feeder_error(self):
diff --git a/Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst b/Misc/NEWS.d/next/Library/2018-03-21-17-59-39.bpo-33078.PQOniT.rst
new file mode 100644 (file)
index 0000000..8b71bb3
--- /dev/null
@@ -0,0 +1 @@
+Fix the failure on OSX caused by the tests relying on sem_getvalue