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)
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)