forked from pool/python-hypothesis
Matej Cepl
7fc90e2b21
- This release disallows using "typing.ClassVar" with "from_type()" and "register_type_strategy()". Why? Because "ClassVar" can only be used during "class" definition. We don't generate class attributes. It also does not make sense as a runtime type on its own. - Updates our vendored list of top-level domains, which is used by the provisional "domains()" strategy. - Fixes issue #3169, an extremely rare bug which would trigger if an internal least-recently-reused cache dropped a newly added entry immediately after it was added. - Fixes issue #3133 and issue #3144, where attempting to generate Pandas series of lists or sets would fail with confusing errors if you did not specify "dtype=object". - Disallows using "typing.TypeAlias" with "from_type()" and "register_type_strategy()". Why? Because "TypeAlias" is not really a type, it is a tag for type checkers that some expression is a type alias, not something else. It does not make sense for Hypothesis to resolve it as a strategy. - Updates our autoformatting tools, improving our code style without any API changes. - Drops support for Python 3.6, which reached end of life upstream on 2021-12-23. - Adds a temporary hook for a downstream tool, which is not part of the public API. - Updates our copyright headers to use a general authorship statement and omit the year. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-hypothesis?expand=0&rev=147
47 lines
1.1 KiB
Diff
47 lines
1.1 KiB
Diff
---
|
|
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):
|