Skip to content

Commit

Permalink
test: move socksproxy-off assert into AssertionError check for Linux …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
JoshuaMoelans committed Nov 15, 2024
1 parent 1d1f3d1 commit 43805fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions tests/test_integration_crashpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def test_crashpad_capture(cmake, httpserver):


@pytest.mark.skipif(
sys.platform != "darwin", reason="currently proxy tests are only supported on macOS"
sys.platform != "darwin" and sys.platform != "linux",
reason="currently proxy tests are only supported on macOS and Linux",
)
@pytest.mark.parametrize("run_args", [(["http-proxy"]), (["socks5-proxy"])])
@pytest.mark.parametrize("proxy_status", [(["off"]), (["on"])])
Expand Down Expand Up @@ -85,11 +86,15 @@ def test_crashpad_crash_proxy(cmake, httpserver, run_args, proxy_status):
if run_args == ["http-proxy"] and proxy_status == ["off"]:
assert len(httpserver.log) == 0
return
elif run_args == ["socks5-proxy"] and proxy_status == ["off"]:
# Apple's NSURLSession will send the request even if the socks proxy fails
# https://forums.developer.apple.com/forums/thread/705504?answerId=712418022#712418022
# hence there is no (socks5-proxy, off) tuple in the AssertionError catch above
assert len(httpserver.log) == 1
return

assert waiting.result
# Apple's NSURLSession will send the request even if the socks proxy fails
# https://forums.developer.apple.com/forums/thread/705504?answerId=712418022#712418022
# hence there is no (socks5-proxy, off) tuple in the AssertionError catch above

assert len(httpserver.log) == 1
finally:
if proxy_process:
Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ def test_capture_minidump(cmake, httpserver):


@pytest.mark.skipif(
sys.platform != "darwin", reason="currently proxy tests are only supported on macOS"
sys.platform != "darwin" and sys.platform != "linux",
reason="currently proxy tests are only supported on macOS and Linux",
)
@pytest.mark.parametrize("run_args", [(["http-proxy"]), (["socks5-proxy"])])
@pytest.mark.parametrize("proxy_status", [(["off"]), (["on"])])
Expand Down

0 comments on commit 43805fd

Please sign in to comment.