Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dbouassida committed Sep 2, 2024
1 parent c2a52e6 commit 6e1cbe9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/integ/test_vendored_urllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def _execute_request():
return resp

_execute_request()
try:

major_version = int(urllib3.__version__.split(".")[0])

if major_version < 2:
with pytest.raises(ValueError, match="file descriptor cannot be a negative"):
_execute_request()
else:
# In case of urllib3 version >= 2, just execute the request without expecting an error
_execute_request()
except ValueError as e:
if "file descriptor cannot be a negative" in str(e):
raise AssertionError(
"Second _execute_request failed. See linked github issue comment"
)
else:
raise e

0 comments on commit 6e1cbe9

Please sign in to comment.