Skip to content

Commit 4b5e745

Browse files
committed
fix rare test issue
1 parent b2f6737 commit 4b5e745

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

hypothesis-python/tests/nocover/test_argument_validation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ def adjust(ex, **kwargs):
4747
test_raise_invalid_argument = argument_validation_test(BAD_ARGS)
4848

4949

50-
@pytest.mark.parametrize("name", sorted(_all_strategies))
50+
ALL_STRATEGIES_COPY = dict(_all_strategies) # avoid rare weakref issues
51+
52+
53+
@pytest.mark.parametrize("name", sorted(ALL_STRATEGIES_COPY))
5154
def test_consistent_with_api_guide_on_kwonly_args(name):
5255
# Enforce our style-guide: if it has a default value, it should be
5356
# keyword-only, with a few exceptions.
54-
strategy = _all_strategies[name]
57+
strategy = ALL_STRATEGIES_COPY[name]
5558
for arg in inspect.signature(strategy).parameters.values():
5659
assert (
5760
arg.default == Parameter.empty

0 commit comments

Comments
 (0)