Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests that don't throw DeprecationWarning #3738

Merged
merged 3 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/test_client_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from aiohttp.client import ClientSession
from aiohttp.client_reqrep import ClientRequest
from aiohttp.connector import BaseConnector, TCPConnector
from aiohttp.helpers import DEBUG, PY_36
from aiohttp.helpers import PY_36


@pytest.fixture
Expand Down Expand Up @@ -663,11 +663,9 @@ class A(ClientSession):
pass


@pytest.mark.skipif(not DEBUG,
reason="The check is applied in DEBUG mode only")
async def test_client_session_custom_attr(loop) -> None:
session = ClientSession(loop=loop)
with pytest.warns(DeprecationWarning):
with pytest.raises(AttributeError):
session.custom = None


Expand Down
6 changes: 2 additions & 4 deletions tests/test_web_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from aiohttp import log, web
from aiohttp.abc import AbstractAccessLogger
from aiohttp.helpers import DEBUG, PY_36
from aiohttp.helpers import PY_36
from aiohttp.test_utils import make_mocked_coro


Expand Down Expand Up @@ -280,11 +280,9 @@ class A(web.Application):
pass


@pytest.mark.skipif(not DEBUG,
reason="The check is applied in DEBUG mode only")
def test_app_custom_attr() -> None:
app = web.Application()
with pytest.warns(DeprecationWarning):
with pytest.raises(AttributeError):
app.custom = None


Expand Down