Skip to content

Commit fcd9670

Browse files
committed
Remove event_loop fixture, as suggested by pytest
1 parent 1634946 commit fcd9670

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_asyncio/test_lock.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,16 @@ async def test_blocking(self, r):
104104
lock_2 = self.get_lock(r, "foo")
105105
assert lock_2.blocking
106106

107-
async def test_blocking_timeout(self, r, event_loop):
107+
async def test_blocking_timeout(self, r):
108108
lock1 = self.get_lock(r, "foo")
109109
assert await lock1.acquire(blocking=False)
110110
bt = 0.2
111111
sleep = 0.05
112112
lock2 = self.get_lock(r, "foo", sleep=sleep, blocking_timeout=bt)
113-
start = event_loop.time()
113+
start = asyncio.get_running_loop().time()
114114
assert not await lock2.acquire()
115115
# The elapsed duration should be less than the total blocking_timeout
116-
assert bt >= (event_loop.time() - start) > bt - sleep
116+
assert bt >= (asyncio.get_running_loop().time() - start) > bt - sleep
117117
await lock1.release()
118118

119119
async def test_context_manager(self, r):

0 commit comments

Comments
 (0)