diff --git a/test/conftest.py b/test/conftest.py index b3264ea..c69a0e3 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -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] diff --git a/test/test_import_hook.py b/test/test_import_hook.py index ddde0e4..9077082 100644 --- a/test/test_import_hook.py +++ b/test/test_import_hook.py @@ -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")