Skip to content

Commit b4e88e9

Browse files
committed
pytests: really skip nox tests if no wheel is found
1 parent d4e90fc commit b4e88e9

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

pytests/noxfile.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ def test(session: nox.Session):
1111
session.install("-v", ".[dev]")
1212

1313
def try_install_binary(package: str, constraint: str):
14-
try:
15-
session.install("--only-binary=:all:", f"{package}{constraint}")
16-
except CommandFailed:
17-
# No binary wheel available on this platform
18-
pass
19-
20-
try_install_binary("numpy", ">=1.16")
21-
# https://github.com/zopefoundation/zope.interface/issues/316
22-
# - is a dependency of gevent
23-
try_install_binary("zope.interface", "<7")
24-
try_install_binary("gevent", ">=22.10.2")
14+
session.install("--only-binary=:all:", f"{package}{constraint}")
15+
16+
try:
17+
try_install_binary("numpy", ">=1.16")
18+
# https://github.com/zopefoundation/zope.interface/issues/316
19+
# - is a dependency of gevent
20+
try_install_binary("zope.interface", "<7")
21+
try_install_binary("gevent", ">=22.10.2")
22+
except CommandFailed:
23+
# No binary wheel available on this platform
24+
session.skip()
25+
2526
ignored_paths = []
2627
if sys.version_info < (3, 10):
2728
# Match syntax is only available in Python >= 3.10

0 commit comments

Comments
 (0)