mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-134087: enforce signature of threading.RLock
(#134178)
- Reject positional and keyword arguments in `_thread.RLock.__new__`. - Convert `_thread.lock.__new__` to AC.
This commit is contained in:
parent
9983c7d441
commit
d6dc33ed80
7 changed files with 115 additions and 53 deletions
|
@ -124,6 +124,11 @@ class BaseLockTests(BaseTestCase):
|
|||
lock = self.locktype()
|
||||
del lock
|
||||
|
||||
def test_constructor_noargs(self):
|
||||
self.assertRaises(TypeError, self.locktype, 1)
|
||||
self.assertRaises(TypeError, self.locktype, x=1)
|
||||
self.assertRaises(TypeError, self.locktype, 1, x=2)
|
||||
|
||||
def test_repr(self):
|
||||
lock = self.locktype()
|
||||
self.assertRegex(repr(lock), "<unlocked .* object (.*)?at .*>")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue