diff --git a/tests/test_corner_cases.py b/tests/test_corner_cases.py index a0e7b25..a9ddd07 100644 --- a/tests/test_corner_cases.py +++ b/tests/test_corner_cases.py @@ -3,14 +3,14 @@ import pytest -from aiorwlock import RWLock, _current_task +from aiorwlock import RWLock ensure_future = asyncio.ensure_future @contextlib.contextmanager def should_fail(timeout, loop): - task = _current_task(loop) + task = asyncio.current_task(loop) handle = loop.call_later(timeout, task.cancel) try: diff --git a/tests/test_rwlock.py b/tests/test_rwlock.py index 29d9598..9757a19 100644 --- a/tests/test_rwlock.py +++ b/tests/test_rwlock.py @@ -2,7 +2,7 @@ import pytest -from aiorwlock import RWLock, _current_task +from aiorwlock import RWLock class Bunch(object): @@ -24,7 +24,7 @@ def __init__(self, f, n, wait_before_exit=False): self._futures = [] async def task(): - tid = _current_task() + tid = asyncio.current_task() self.started.append(tid) try: await f() @@ -500,14 +500,6 @@ async def coro(): assert not wl.locked -def test_current_task(loop): - with pytest.raises(RuntimeError): - _current_task(loop) - - with pytest.raises(RuntimeError): - _current_task() - - @pytest.mark.asyncio async def test_read_context_manager(loop, fast_track): rwlock = RWLock(fast=fast_track)