Skip to content

Commit f9c1329

Browse files
committed
Fix tests
1 parent f8f1062 commit f9c1329

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

tests/conftest.py

-11
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,3 @@ def test_data_fixture(request):
1616
with file.open("r") as fh:
1717
test_data = json.load(fh)
1818
setattr(request.cls, filename, test_data)
19-
20-
21-
@pytest.fixture()
22-
def event_loop():
23-
loop = asyncio.get_event_loop()
24-
yield loop
25-
to_cancel = asyncio.tasks.all_tasks(loop)
26-
for task in to_cancel:
27-
task.cancel()
28-
loop.run_until_complete(asyncio.tasks.gather(*to_cancel, return_exceptions=True))
29-
loop.close()

tests/test_api.py

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ async def test_api(self, request, httpx_mock):
3030
httpx_mock.add_response(json=request.cls.info)
3131
r = await _Api()._call("") # pylint: disable=protected-access
3232
assert r.json() == request.cls.info
33+
34+
httpx_mock.add_response(json=request.cls.info)
3335
client = AsyncClient()
3436
r = await _Api(client)._call("") # pylint: disable=protected-access
3537
await client.aclose()

0 commit comments

Comments
 (0)