Skip to content

Commit

Permalink
Skip test_connection_timeout_tcp for python3.6 since it's prohibited …
Browse files Browse the repository at this point in the history
…to access httpbin from CI
  • Loading branch information
cdeler committed Nov 25, 2020
1 parent efc45c4 commit 41a6f25
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
3 changes: 3 additions & 0 deletions tests/async_tests/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ async def test_cannot_connect_uds(backend: str) -> None:
await http.arequest(method, url)


@pytest.mark.skipif(
sys.version_info[:2] < (3, 7), reason="Hypercorn doesn't support python < 3.7"
)
@pytest.mark.anyio
async def test_connection_timeout_tcp(backend: str, slow_tcp_server: Server) -> None:
method = b"GET"
Expand Down
23 changes: 9 additions & 14 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@
SERVER_HTTP_PORT = 80
SERVER_HTTPS_PORT = 443
HTTPS_SERVER_URL = "https://example.org"
SLOW_SERVER_HOST = "httpbin.org"
SLOW_SERVER_PORT = 443
else:
SERVER_HOST = "localhost"
SERVER_HTTP_PORT = 8002
SERVER_HTTPS_PORT = 8003
HTTPS_SERVER_URL = f"https://localhost:{SERVER_HTTPS_PORT}"
SLOW_SERVER_HOST = SERVER_HOST
SLOW_SERVER_PORT = 8004

SLOW_SERVER_HOST = SERVER_HOST
SLOW_SERVER_PORT = 8004


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -194,18 +193,14 @@ def https_server(

@pytest.fixture(scope="session")
def slow_tcp_server() -> typing.Iterator[Server]:
server: Server
assert hypercorn is not None

if hypercorn is None:
server = LiveServer(host=SLOW_SERVER_HOST, port=SLOW_SERVER_PORT)
yield server
else:
server = HypercornServer(
app=slow_app, bind=f"{SLOW_SERVER_HOST}:{SLOW_SERVER_PORT}"
)
server = HypercornServer(
app=slow_app, bind=f"{SLOW_SERVER_HOST}:{SLOW_SERVER_PORT}"
)

with server.serve_in_thread():
yield server
with server.serve_in_thread():
yield server


@pytest.fixture(scope="function")
Expand Down
3 changes: 3 additions & 0 deletions tests/sync_tests/test_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ def test_cannot_connect_uds(backend: str) -> None:
http.request(method, url)


@pytest.mark.skipif(
sys.version_info[:2] < (3, 7), reason="Hypercorn doesn't support python < 3.7"
)

def test_connection_timeout_tcp(backend: str, slow_tcp_server: Server) -> None:
method = b"GET"
Expand Down

0 comments on commit 41a6f25

Please sign in to comment.