Esempio n. 1
0
 def test_trylock(self, space):
     lock = interp_bufferedio.TryLock(space)
     with lock:
         pass
     with lock:
         exc = py.test.raises(OperationError, "with lock: pass")
     assert exc.value.match(space, space.w_RuntimeError)
Esempio n. 2
0
 def test_trylock(self):
     space = gettestobjspace(usemodules=['thread'])
     lock = interp_bufferedio.TryLock(space)
     with lock:
         pass
     with lock:
         exc = py.test.raises(OperationError, "with lock: pass")
     assert exc.value.match(space, space.w_RuntimeError)