--- tests/conjecture/test_utils.py | 3 ++- tests/ghostwriter/test_expected_output.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) --- a/tests/conjecture/test_utils.py +++ b/tests/conjecture/test_utils.py @@ -11,7 +11,6 @@ from collections import Counter from fractions import Fraction -import numpy as np import pytest from hypothesis import ( @@ -213,11 +212,13 @@ def test_combine_labels_is_distinct(): def test_invalid_numpy_sample(): + np = pytest.importorskip("numpy") with pytest.raises(InvalidArgument): cu.check_sample(np.array([[1, 1], [1, 1]]), "array") def test_valid_numpy_sample(): + np = pytest.importorskip("numpy") cu.check_sample(np.array([1, 2, 3]), "array") --- a/tests/ghostwriter/test_expected_output.py +++ b/tests/ghostwriter/test_expected_output.py @@ -23,13 +23,13 @@ import re import sys from typing import Sequence -import numpy import pytest import hypothesis from hypothesis.extra import ghostwriter from hypothesis.utils.conventions import not_set +numpy = pytest.importorskip("numpy") @pytest.fixture def update_recorded_outputs(request):