(self)
| 2320 | locktype = staticmethod(threading._CRLock) |
| 2321 | |
| 2322 | def test_signature(self): # gh-102029 |
| 2323 | with warnings.catch_warnings(record=True) as warnings_log: |
| 2324 | threading.RLock() |
| 2325 | self.assertEqual(warnings_log, []) |
| 2326 | |
| 2327 | arg_types = [ |
| 2328 | ((1,), {}), |
| 2329 | ((), {'a': 1}), |
| 2330 | ((1, 2), {'a': 1}), |
| 2331 | ] |
| 2332 | for args, kwargs in arg_types: |
| 2333 | with self.subTest(args=args, kwargs=kwargs): |
| 2334 | self.assertRaises(TypeError, threading.RLock, *args, **kwargs) |
| 2335 | |
| 2336 | # Subtypes with custom `__init__` are allowed (but, not recommended): |
| 2337 | class CustomRLock(self.locktype): |
| 2338 | def __init__(self, a, *, b) -> None: |
| 2339 | super().__init__() |
| 2340 | |
| 2341 | with warnings.catch_warnings(record=True) as warnings_log: |
| 2342 | CustomRLock(1, b=2) |
| 2343 | self.assertEqual(warnings_log, []) |
| 2344 | |
| 2345 | class EventTests(lock_tests.EventTests): |
| 2346 | eventtype = staticmethod(threading.Event) |
nothing calls this directly
no test coverage detected