Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add test for ClientSession setup/teardown
  • Loading branch information
james-gray committed Apr 2, 2020
commit 6f231ce30c569ea2b0ed1f75304a5483329caae5
19 changes: 19 additions & 0 deletions tests/test_httputils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pytest

from app.utils import httputils


@pytest.mark.asyncio
async def test_setup_teardown_client_session():
with pytest.raises(AttributeError):
# Ensure client_session is undefined prior to setup
httputils.client_session

await httputils.setup_client_session()

assert httputils.client_session

await httputils.teardown_client_session()
assert httputils.client_session.closed

del httputils.client_session