MCPcopy Index your code
hub / github.com/RustPython/RustPython / _check_notify

Method _check_notify

Lib/test/lock_tests.py:503–521  ·  view source on GitHub ↗
(self, evt)

Source from the content-addressed store, hash-verified

501 self.assertFalse(evt.is_set())
502
503 def _check_notify(self, evt):
504 # All threads get notified
505 N = 5
506 results1 = []
507 results2 = []
508 def f():
509 results1.append(evt.wait())
510 results2.append(evt.wait())
511
512 with Bunch(f, N):
513 # Threads blocked on first evt.wait()
514 wait_threads_blocked(N)
515 self.assertEqual(len(results1), 0)
516
517 # Threads unblocked
518 evt.set()
519
520 self.assertEqual(results1, [True] * N)
521 self.assertEqual(results2, [True] * N)
522
523 def test_notify(self):
524 evt = self.eventtype()

Callers 1

test_notifyMethod · 0.95

Calls 5

wait_threads_blockedFunction · 0.85
lenFunction · 0.85
BunchClass · 0.70
assertEqualMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected