diff options
author | Clinton <pygeek@users.noreply.github.com> | 2024-07-30 08:53:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-30 08:53:07 (GMT) |
commit | d27a53fc02a87e76066fc4e15ff1fff3922a482d (patch) | |
tree | 2cc1bfaaa7b9c040774dbe77e628658267cc5fcd /Lib/test/lock_tests.py | |
parent | 3a9b2aae615165a40614db9aaa8b90c55ff0c7f9 (diff) | |
download | cpython-d27a53fc02a87e76066fc4e15ff1fff3922a482d.zip cpython-d27a53fc02a87e76066fc4e15ff1fff3922a482d.tar.gz cpython-d27a53fc02a87e76066fc4e15ff1fff3922a482d.tar.bz2 |
gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480)
Diffstat (limited to 'Lib/test/lock_tests.py')
-rw-r--r-- | Lib/test/lock_tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py index 024c6de..8c8f890 100644 --- a/Lib/test/lock_tests.py +++ b/Lib/test/lock_tests.py @@ -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 |