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

Correct pytest fixture #282

Merged
merged 1 commit into from
Feb 10, 2025
Merged
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
8 changes: 4 additions & 4 deletions python/_restclient/tests/test_restclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def test_get_headers_have_precedent_over_instance(basic_test_server):
assert all(k_v_pair in r.headers.items() for k_v_pair in method_headers.items())


def test_build_url(loop):
def test_build_url(event_loop):
base_url = "http://www.test.gov/"
query_params = {"key": "value"}
with RestClient(enable_cache=False, loop=loop) as client:
with RestClient(enable_cache=False, loop=event_loop) as client:

assert client.build_url(base_url) == base_url
assert client.build_url(base_url, query_params) == f"{base_url}?key=value"
Expand All @@ -156,7 +156,7 @@ class ModuleFoundError(Exception):
...


def test_restclient_nest_asyncio_ModuleNotFoundError(loop):
def test_restclient_nest_asyncio_ModuleNotFoundError(event_loop):
"""Test for #99. Ensure ModuleNotFoundError raised if `nest_asyncio` not installed"""
import asyncio
import warnings
Expand All @@ -183,4 +183,4 @@ async def test():
# this test will need to change if `nest_asyncio` becomes a requirement
RestClient(enable_cache=False)

loop.run_until_complete(test())
event_loop.run_until_complete(test())