mirror of
https://github.com/python/cpython.git
synced 2025-08-09 19:38:42 +00:00
[3.12] gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480) (GH-122443)
(cherry picked from commit d27a53fc02
)
Co-authored-by: Clinton <pygeek@users.noreply.github.com>
This commit is contained in:
parent
9491d18975
commit
ca2275025b
3 changed files with 8 additions and 0 deletions
|
@ -1013,6 +1013,10 @@ class BarrierTests(BaseTestCase):
|
|||
self.assertEqual(self.barrier.n_waiting, 0)
|
||||
self.assertFalse(self.barrier.broken)
|
||||
|
||||
def test_constructor(self):
|
||||
self.assertRaises(ValueError, self.barriertype, parties=0)
|
||||
self.assertRaises(ValueError, self.barriertype, parties=-1)
|
||||
|
||||
def test_barrier(self, passes=1):
|
||||
"""
|
||||
Test that a barrier is passed in lockstep
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue