Skip to content

Commit

Permalink
Fix tests that don't throw DeprecationWarning (#3738)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Yushkovskiy authored and asvetlov committed May 10, 2019
1 parent ee2951f commit 74a46a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
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

0 comments on commit 74a46a5

Please sign in to comment.