gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480)

This commit is contained in:
Clinton 2024-07-30 04:53:07 -04:00 committed by GitHub
parent 3a9b2aae61
commit d27a53fc02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View file

@ -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