Skip to content

Commit

Permalink
Fix stacklevel for deprecated pytest fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jan 24, 2020
1 parent 7bdee2c commit 434a9f3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions aiohttp/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@ def proactor_loop(): # type: ignore
@pytest.fixture
def unused_port(aiohttp_unused_port): # type: ignore # pragma: no cover
warnings.warn("Deprecated, use aiohttp_unused_port fixture instead",
DeprecationWarning)
DeprecationWarning,
stacklevel=2)
return aiohttp_unused_port


Expand Down Expand Up @@ -270,7 +271,8 @@ async def finalize(): # type: ignore
@pytest.fixture
def test_server(aiohttp_server): # type: ignore # pragma: no cover
warnings.warn("Deprecated, use aiohttp_server fixture instead",
DeprecationWarning)
DeprecationWarning,
stacklevel=2)
return aiohttp_server


Expand Down Expand Up @@ -300,7 +302,8 @@ async def finalize(): # type: ignore
@pytest.fixture
def raw_test_server(aiohttp_raw_server): # type: ignore # pragma: no cover
warnings.warn("Deprecated, use aiohttp_raw_server fixture instead",
DeprecationWarning)
DeprecationWarning,
stacklevel=2)
return aiohttp_raw_server


Expand Down Expand Up @@ -348,5 +351,6 @@ async def finalize(): # type: ignore
@pytest.fixture
def test_client(aiohttp_client): # type: ignore # pragma: no cover
warnings.warn("Deprecated, use aiohttp_client fixture instead",
DeprecationWarning)
DeprecationWarning,
stacklevel=2)
return aiohttp_client

0 comments on commit 434a9f3

Please sign in to comment.