Made missing beartype result in test skips rather than tests not running

This commit is contained in:
Patrick Kidger
2022-07-12 10:07:42 +01:00
parent 9f75958b2d
commit e162e1281a
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -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]
+1 -1
View File
@@ -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")