File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,6 @@ def test_rlock_block(this_lock):
6868
6969 # Override owner to force acquisition failure
7070 this_lock ._owner = None
71- print (this_lock ._owner )
7271 # Assert not owner
7372 assert not this_lock ._is_owned ()
7473
@@ -88,22 +87,30 @@ def test_rlock_block(this_lock):
8887
8988 # Release lock, assert no owner
9089 assert not this_lock ._is_owned ()
91-
92- def test_rlock_acquire_timeout (this_lock ):
90+
91+
92+ def test_rlock_acquire_timeout_pass (this_lock ):
93+ # Assert acquisition fails using context manager
94+ with this_lock (timeout = 0.01 ) as result :
95+ assert result is True
96+
97+ assert not this_lock .locked ()
98+
99+
100+ def test_rlock_acquire_timeout_fail (this_lock ):
93101 from labthings .core .exceptions import LockError
94102
95103 # Acquire lock
96104 assert this_lock .acquire ()
97105
98106 # Override owner to force acquisition failure
99107 this_lock ._owner = None
100- print (this_lock ._owner )
101108 # Assert not owner
102109 assert not this_lock ._is_owned ()
103110
104111 # Assert acquisition fails using context manager
105112 with pytest .raises (LockError ):
106- with this_lock (timeout = 0.01 ):
113+ with this_lock (timeout = 0.01 ) as result :
107114 pass
108115
109116 # Force ownership
You can’t perform that action at this time.
0 commit comments