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

Add a network pytest mark for tests that use the network #1669

Merged
merged 5 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ combine_as_imports = True
addopts = -rxXs
markers =
copied_from(source, changes=None): mark test as copied from somewhere else, along with a description of changes made to accodomate e.g. our test setup
network: marks tests which require network connection
antlarr marked this conversation as resolved.
Show resolved Hide resolved

[coverage:run]
omit = venv/*
Expand Down
2 changes: 2 additions & 0 deletions tests/client/test_proxies.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def test_transport_for_request(url, proxies, expected):


@pytest.mark.asyncio
@pytest.mark.network
async def test_async_proxy_close():
try:
client = httpx.AsyncClient(proxies={"https://": PROXY_URL})
Expand All @@ -130,6 +131,7 @@ async def test_async_proxy_close():
await client.aclose()


@pytest.mark.network
def test_sync_proxy_close():
try:
client = httpx.Client(proxies={"https://": PROXY_URL})
Expand Down
1 change: 1 addition & 0 deletions tests/test_timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async def test_write_timeout(server):


@pytest.mark.usefixtures("async_environment")
@pytest.mark.network
async def test_connect_timeout(server):
timeout = httpx.Timeout(None, connect=1e-6)

Expand Down