mirror of
https://github.com/wassname/jaxtyping.git
synced 2026-09-09 11:24:55 +08:00
Made missing beartype result in test skips rather than tests not running
This commit is contained in:
+5
-1
@@ -27,7 +27,11 @@ import typeguard
|
||||
try:
|
||||
import beartype
|
||||
except ImportError:
|
||||
typecheck_params = [typeguard.typechecked]
|
||||
|
||||
def skip(*args, **kwargs):
|
||||
pytest.skip("Beartype not installed")
|
||||
|
||||
typecheck_params = [typeguard.typechecked, skip]
|
||||
else:
|
||||
typecheck_params = [typeguard.typechecked, beartype.beartype]
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ def test_import_hook_beartype():
|
||||
try:
|
||||
import beartype # noqa: F401
|
||||
except ImportError:
|
||||
pass
|
||||
pytest.skip("Beartype not installed")
|
||||
else:
|
||||
hook = install_import_hook(
|
||||
"test.import_hook_tester_beartype", ("beartype", "beartype")
|
||||
|
||||
Reference in New Issue
Block a user