Skip to content

Commit

Permalink
chore(test): enable known external network calls
Browse files Browse the repository at this point in the history
Not using the `network` marker as a filter - there are currently 133,
and not all of them are actually making network calls.

Signed-off-by: Mike Fiedler <[email protected]>
  • Loading branch information
miketheman committed Jan 3, 2025
1 parent 69e12cd commit 1f9432b
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/functional/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def test_list_all_versions_search_with_pre(script: PipTestEnvironment) -> None:
)


@pytest.mark.enable_socket
@pytest.mark.network
def test_list_all_versions_returns_no_matches_found_when_name_not_exact() -> None:
"""
Expand All @@ -63,6 +64,7 @@ def test_list_all_versions_returns_no_matches_found_when_name_not_exact() -> Non
assert status == ERROR


@pytest.mark.enable_socket
@pytest.mark.network
def test_list_all_versions_returns_matches_found_when_name_is_exact() -> None:
"""
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_network_lazy_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def mypy_whl_no_range(mock_server: MockServer, shared_data: TestData) -> Iterato
mock_server.stop()


@pytest.mark.enable_socket
@pytest.mark.network
def test_dist_from_wheel_url(session: PipSession) -> None:
"""Test if the acquired distribution contain correct information."""
Expand All @@ -53,6 +54,7 @@ def test_dist_from_wheel_url(session: PipSession) -> None:
assert {str(d) for d in dist.iter_dependencies(extras)} == MYPY_0_782_REQS


@pytest.mark.enable_socket
def test_dist_from_wheel_url_no_range(
session: PipSession, mypy_whl_no_range: str
) -> None:
Expand All @@ -61,6 +63,7 @@ def test_dist_from_wheel_url_no_range(
dist_from_wheel_url("mypy", mypy_whl_no_range, session)


@pytest.mark.enable_socket
@pytest.mark.network
def test_dist_from_wheel_url_not_zip(session: PipSession) -> None:
"""Test handling with the given URL does not point to a ZIP."""
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_network_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def warning(self, *args: Any, **kwargs: Any) -> None:
assert actual_level == "WARNING"
assert "is not a trusted or secure host" in actual_message

@pytest.mark.enable_socket
@pytest.mark.network
def test_proxy(self, proxy: Optional[str]) -> None:
session = PipSession(trusted_hosts=[])
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_req.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def test_download_info_find_links(self, data: TestData) -> None:
assert isinstance(req.download_info.info, ArchiveInfo)
assert req.download_info.info.hash

@pytest.mark.enable_socket
@pytest.mark.network
def test_download_info_index_url(self) -> None:
"""Test that download_info is set for requirements via index."""
Expand All @@ -377,6 +378,7 @@ def test_download_info_index_url(self) -> None:
assert req.download_info
assert isinstance(req.download_info.info, ArchiveInfo)

@pytest.mark.enable_socket
@pytest.mark.network
def test_download_info_web_archive(self) -> None:
"""Test that download_info is set for requirements from a web archive."""
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,7 @@ def test_variant5(
class TestParseRequirements:
"""tests for `parse_reqfile`"""

@pytest.mark.enable_socket
@pytest.mark.network
def test_remote_reqs_parse(self) -> None:
"""
Expand Down

0 comments on commit 1f9432b

Please sign in to comment.