Skip to content

Commit 844e19d

Browse files
committed
Skip tests if unauthorised for model
1 parent 9a443e6 commit 844e19d

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tests/test_mlip_calculators.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,14 @@ def test_mlips(arch, device, kwargs):
157157
except BadZipFile:
158158
pytest.skip("Model download failed")
159159
except HTTPError as err: # Inherits from URLError, so check first
160-
if "Service Unavailable" in err.msg or "Too Many Requests for url" in err.msg:
160+
if any(
161+
msg in err.msg
162+
for msg in (
163+
"Service Unavailable",
164+
"Too Many Requests for url",
165+
"Unauthorized for url",
166+
)
167+
):
161168
pytest.skip("Model download failed")
162169
raise err
163170
except URLError as err:

tests/test_single_point.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,14 @@ def test_extras(arch, device, expected_energy, struct, kwargs):
171171
energy = single_point.run()["energy"]
172172
assert energy == pytest.approx(expected_energy, rel=1e-3)
173173
except HTTPError as err: # Inherits from URLError, so check first
174-
if "Service Unavailable" in err.msg or "Too Many Requests for url" in err.msg:
174+
if any(
175+
msg in err.msg
176+
for msg in (
177+
"Service Unavailable",
178+
"Too Many Requests for url",
179+
"Unauthorized for url",
180+
)
181+
):
175182
pytest.skip("Model download failed")
176183
raise err
177184
except URLError as err:

0 commit comments

Comments
 (0)