Skip to content

Commit

Permalink
store the "removed in numpy 2" mark in a variable
Browse files Browse the repository at this point in the history
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
  • Loading branch information
keewis and Zac-HD committed Apr 25, 2024
1 parent fe34343 commit 8d5ef72
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions hypothesis-python/tests/numpy/test_from_dtype.py
Expand Up @@ -128,18 +128,11 @@ def test_byte_string_dtypes_generate_unicode_strings(data):
assert isinstance(result, bytes)


skipif_np2 = pytest.mark.skipif(np_version >= (2, 0), reason="removed in new version")

@pytest.mark.parametrize(
"dtype",
[
"U",
"S",
pytest.param(
"a",
marks=pytest.mark.skipif(
np_version >= (2, 0), reason="not supported on `numpy>=2.0`"
),
),
],
["U", "S", pytest.param("a", marks=skipif_np2)],
)
def test_unsized_strings_length_gt_one(dtype):
# See https://github.com/HypothesisWorks/hypothesis/issues/2229
Expand Down

0 comments on commit 8d5ef72

Please sign in to comment.