Skip to content

Commit

Permalink
Revert test case workaround
Browse files Browse the repository at this point in the history
aiohappyeyeballs 2.4.3 no longer needs the workaround.

This mostly reverts 1bcd135, while keeping the unpinned, latest version of aiohttp.
  • Loading branch information
john-kurkowski committed Sep 30, 2024
1 parent e702b62 commit cf000fe
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions tests/test_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from unittest import mock

import pytest
import pytest_socket # type: ignore[import-untyped]
from click.testing import CliRunner
from syrupy.assertion import SnapshotAssertion

Expand All @@ -33,22 +34,13 @@ def some_paths(tmp_path: Path) -> list[Path]:

def test_main_no_network_calls(some_paths: list[Path]) -> None:
"""Test that main network calls are blocked."""
# aiohttp 3.10.0 seems to swallow the conventional exception from
# pytest_socket, and then has its own, more generic, uncaught exception in
# a transitive project, aiohappyeyeballs. Instead of verifying
# pytest_socket directly, verify the exception from aiohappyeyeballs.
#
# with pytest.raises(pytest_socket.SocketBlockedError):
with pytest.raises(IndexError) as exc:
with pytest.raises(pytest_socket.SocketBlockedError):
CliRunner(mix_stderr=False).invoke(
upload,
[str(path.parent.resolve()) for path in some_paths],
catch_exceptions=False,
)

if "aiohappyeyeballs" not in str(exc.traceback[-1].path):
raise exc.value


def test_main_tracks_not_found(
requests_mocks: RequestsMocks, snapshot: SnapshotAssertion, some_paths: list[Path]
Expand Down

0 comments on commit cf000fe

Please sign in to comment.