Example #1
0
 def test_locked(self):
     lock = AssertingLock()
     with self.assertRaises(AssertionError):
         with lock:
             with lock:
                 pass
Example #2
0
 def setUp(self):
     # Will raise if more then one thread try to enter the sampling method
     self.single_thread_allowed = AssertingLock()
     self.entered_sampling_method = threading.Event()
     self.results = ['result-1', 'result-2']
Example #3
0
 def test_free(self):
     lock = AssertingLock()
     with lock:
         pass