summaryrefslogtreecommitdiffstats
path: root/Lib/test/lock_tests.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-07-30 09:24:35 (GMT)
committerGitHub <noreply@github.com>2024-07-30 09:24:35 (GMT)
commit202cfbfb7cd54fb40240cb23b3b828c4ba4471cf (patch)
treec19eb4e3fb950e17c327eda32833b5ea8b0cba8c /Lib/test/lock_tests.py
parent466bb0d7eac4a4dbd8fb6050a50489680cbfe765 (diff)
downloadcpython-202cfbfb7cd54fb40240cb23b3b828c4ba4471cf.zip
cpython-202cfbfb7cd54fb40240cb23b3b828c4ba4471cf.tar.gz
cpython-202cfbfb7cd54fb40240cb23b3b828c4ba4471cf.tar.bz2
[3.13] gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480) (GH-122444)
(cherry picked from commit d27a53fc02a87e76066fc4e15ff1fff3922a482d) Co-authored-by: Clinton <pygeek@users.noreply.github.com>
Diffstat (limited to 'Lib/test/lock_tests.py')
-rw-r--r--Lib/test/lock_tests.py4
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