mirror of https://github.com/python/cpython
Merge #14333: fix test_queue so it can be run via standard unittest test discovery.
This commit is contained in:
commit
0863d7106c
|
@ -82,7 +82,7 @@ class BlockingTestMixin:
|
||||||
self.fail("trigger thread ended but event never set")
|
self.fail("trigger thread ended but event never set")
|
||||||
|
|
||||||
|
|
||||||
class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
|
class BaseQueueTestMixin(BlockingTestMixin):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.cum = 0
|
self.cum = 0
|
||||||
self.cumlock = threading.Lock()
|
self.cumlock = threading.Lock()
|
||||||
|
@ -229,13 +229,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
|
||||||
with self.assertRaises(queue.Full):
|
with self.assertRaises(queue.Full):
|
||||||
q.put_nowait(4)
|
q.put_nowait(4)
|
||||||
|
|
||||||
class QueueTest(BaseQueueTest):
|
class QueueTest(BaseQueueTestMixin, unittest.TestCase):
|
||||||
type2test = queue.Queue
|
type2test = queue.Queue
|
||||||
|
|
||||||
class LifoQueueTest(BaseQueueTest):
|
class LifoQueueTest(BaseQueueTestMixin, unittest.TestCase):
|
||||||
type2test = queue.LifoQueue
|
type2test = queue.LifoQueue
|
||||||
|
|
||||||
class PriorityQueueTest(BaseQueueTest):
|
class PriorityQueueTest(BaseQueueTestMixin, unittest.TestCase):
|
||||||
type2test = queue.PriorityQueue
|
type2test = queue.PriorityQueue
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue