File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import sys
1010
1111import pytest
12+ import requests
1213
1314import blosc2
1415
@@ -36,15 +37,11 @@ def cat2_context():
3637 yield c2params
3738
3839
39- # This is to avoid sporadic failures in the CI when reaching network,
40- # but this makes the tests to stuck in local. Perhaps move this to
41- # every test module that needs it?
42- # def pytest_runtest_call(item):
43- # try:
44- # item.runtest()
45- # except requests.ConnectTimeout:
46- # pytest.skip("Skipping test due to sporadic requests.ConnectTimeout")
47- # except requests.ReadTimeout:
48- # pytest.skip("Skipping test due to sporadic requests.ReadTimeout")
49- # except requests.Timeout:
50- # pytest.skip("Skipping test due to sporadic requests.Timeout")
40+ def pytest_runtest_call (item ):
41+ # Skip network-marked tests on transient request failures to keep CI stable.
42+ if item .get_closest_marker ("network" ) is None :
43+ return
44+ try :
45+ item .runtest ()
46+ except requests .exceptions .RequestException as exc :
47+ pytest .skip (f"Skipping network test due to request failure: { exc } " )
You can’t perform that action at this time.
0 commit comments