Skip to content

Commit 5929385

Browse files
authored
Merge pull request #4541 from HypothesisWorks/create-pull-request/patch
Update pinned dependencies
2 parents fbb937f + d602f34 commit 5929385

File tree

16 files changed

+41
-39
lines changed

16 files changed

+41
-39
lines changed

hypothesis-python/RELEASE.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
RELEASE_TYPE: patch
2+
3+
Internal refactoring for new lint rules.

hypothesis-python/src/hypothesis/_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def __init__(
629629
)
630630
self._deadline = (
631631
self._fallback.deadline # type: ignore
632-
if deadline is not_set
632+
if deadline is not_set # type: ignore
633633
else _validate_deadline(deadline)
634634
)
635635
self._print_blob = (

hypothesis-python/src/hypothesis/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ def unwrap_markers_from_group() -> Generator[None, None, None]:
867867
try:
868868
yield
869869
except BaseExceptionGroup as excgroup:
870-
frozen_exceptions, non_frozen_exceptions = excgroup.split(Frozen)
870+
_frozen_exceptions, non_frozen_exceptions = excgroup.split(Frozen)
871871

872872
# group only contains Frozen, reraise the group
873873
# it doesn't matter what we raise, since any exceptions get disregarded

hypothesis-python/tests/conjecture/test_provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def test_function(n):
417417

418418
with pytest.raises(
419419
HypothesisException,
420-
match="expected .* from BadRealizeProvider.realize",
420+
match=r"expected .* from BadRealizeProvider.realize",
421421
):
422422
test_function()
423423

hypothesis-python/tests/cover/test_float_nastiness.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test_can_guard_against_draws_of_nan():
113113
st.tuples(st.just(1), st.floats(allow_nan=True)),
114114
)
115115

116-
tag, f = minimal(tagged_floats, lambda x: math.isnan(x[1]))
116+
tag, _f = minimal(tagged_floats, lambda x: math.isnan(x[1]))
117117
assert tag == 1
118118

119119

@@ -238,7 +238,7 @@ def test_exclude_infinite_endpoint_is_invalid():
238238
@pytest.mark.parametrize("lo,hi", [(True, False), (False, True), (True, True)])
239239
@given(bound=st.floats(allow_nan=False, allow_infinity=False).filter(bool))
240240
def test_exclude_entire_interval(lo, hi, bound):
241-
with pytest.raises(InvalidArgument, match="exclude_min=.+ and exclude_max="):
241+
with pytest.raises(InvalidArgument, match=r"exclude_min=.+ and exclude_max="):
242242
st.floats(bound, bound, exclude_min=lo, exclude_max=hi).validate()
243243

244244

hypothesis-python/tests/cover/test_sampled_from.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class AnnotationsInsteadOfElements(enum.Enum):
203203

204204

205205
def test_suggests_elements_instead_of_annotations():
206-
with pytest.raises(InvalidArgument, match="Cannot sample.*annotations.*dataclass"):
206+
with pytest.raises(InvalidArgument, match=r"Cannot sample.*annotations.*dataclass"):
207207
check_can_generate_examples(st.sampled_from(AnnotationsInsteadOfElements))
208208

209209

hypothesis-python/tests/cover/test_stateful.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def fail_fast(self):
260260
# Make sure MultipleResult is iterable so the printed code is valid.
261261
# See https://github.com/HypothesisWorks/hypothesis/issues/2311
262262
state = ProducesMultiple()
263-
b_0, b_1 = state.populate_bundle()
263+
_b_0, _b_1 = state.populate_bundle()
264264
with raises(AssertionError):
265265
state.fail_fast()
266266

@@ -918,7 +918,7 @@ def test_initialize_rule_dont_mix_with_precondition():
918918
with pytest.raises(
919919
InvalidDefinition,
920920
match=(
921-
"BadStateMachine.initialize has been decorated with both @initialize "
921+
"BadStateMachine\\.initialize has been decorated with both @initialize "
922922
"and @precondition"
923923
),
924924
):
@@ -934,7 +934,7 @@ def initialize(self):
934934
with pytest.raises(
935935
InvalidDefinition,
936936
match=(
937-
"BadStateMachineReverseOrder.initialize has been decorated with both "
937+
"BadStateMachineReverseOrder\\.initialize has been decorated with both "
938938
"@initialize and @precondition"
939939
),
940940
):
@@ -949,7 +949,7 @@ def initialize(self):
949949
def test_initialize_rule_dont_mix_with_regular_rule():
950950
with pytest.raises(
951951
InvalidDefinition,
952-
match="BadStateMachine.initialize has been decorated with both @rule and @initialize",
952+
match="BadStateMachine\\.initialize has been decorated with both @rule and @initialize",
953953
):
954954

955955
class BadStateMachine(RuleBasedStateMachine):
@@ -961,7 +961,7 @@ def initialize(self):
961961
with pytest.raises(
962962
InvalidDefinition,
963963
match=(
964-
"BadStateMachineReverseOrder.initialize has been decorated with both "
964+
"BadStateMachineReverseOrder\\.initialize has been decorated with both "
965965
"@rule and @initialize"
966966
),
967967
):
@@ -976,7 +976,7 @@ def initialize(self):
976976
def test_initialize_rule_cannot_be_double_applied():
977977
with pytest.raises(
978978
InvalidDefinition,
979-
match="BadStateMachine.initialize has been decorated with @initialize twice",
979+
match="BadStateMachine\\.initialize has been decorated with @initialize twice",
980980
):
981981

982982
class BadStateMachine(RuleBasedStateMachine):
@@ -1251,7 +1251,7 @@ def step(self):
12511251
def test_fails_on_settings_class_attribute():
12521252
with pytest.raises(
12531253
InvalidDefinition,
1254-
match="Assigning .+ as a class attribute does nothing",
1254+
match=r"Assigning .+ as a class attribute does nothing",
12551255
):
12561256
run_state_machine_as_test(ErrorsOnClassAttributeSettings)
12571257

@@ -1488,7 +1488,7 @@ def trivial(self, n):
14881488
with pytest.raises(
14891489
InvalidDefinition,
14901490
match=(
1491-
"BadStateMachine.has_precondition_but_no_rule has been decorated "
1491+
"BadStateMachine\\.has_precondition_but_no_rule has been decorated "
14921492
"with @precondition, but not @rule"
14931493
),
14941494
):

hypothesis-python/tests/cover/test_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ def test_check_strategy_might_suggest_sampled_from():
271271
with pytest.raises(InvalidArgument) as excinfo:
272272
check_strategy_("not a strategy")
273273
assert "sampled_from" not in str(excinfo.value)
274-
with pytest.raises(InvalidArgument, match="such as st.sampled_from"):
274+
with pytest.raises(InvalidArgument, match="such as st\\.sampled_from"):
275275
check_strategy_([1, 2, 3])
276-
with pytest.raises(InvalidArgument, match="such as st.sampled_from"):
276+
with pytest.raises(InvalidArgument, match="such as st\\.sampled_from"):
277277
check_strategy_((1, 2, 3))
278278
check_strategy_(integers(), "passes for our custom coverage check")
279279

hypothesis-python/tests/nocover/test_precise_shrinking.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_can_precisely_shrink_values(typ, strat, require_truthy):
170170
cond = bool
171171
else:
172172
cond = lambda x: True
173-
result, shrunk = precisely_shrink(strat, is_interesting=cond)
173+
_result, shrunk = precisely_shrink(strat, is_interesting=cond)
174174
assert shrunk == find(strat, cond)
175175

176176

@@ -191,7 +191,7 @@ def test_can_precisely_shrink_alternatives(i, j, a, seed):
191191
types = [u for u, _ in a]
192192
combined_strategy = st.one_of(*[v for _, v in a])
193193

194-
result, value = precisely_shrink(
194+
_result, value = precisely_shrink(
195195
combined_strategy,
196196
initial_condition=lambda x: isinstance(x, types[j]),
197197
is_interesting=lambda x: not any(isinstance(x, types[k]) for k in range(i)),
@@ -213,7 +213,7 @@ def test_precise_shrink_with_blocker(a, seed):
213213
types = [u for u, _ in a]
214214
combined_strategy = st.one_of(*[v for _, v in a])
215215

216-
result, value = precisely_shrink(
216+
_result, value = precisely_shrink(
217217
combined_strategy,
218218
initial_condition=lambda x: isinstance(x, types[2]),
219219
is_interesting=lambda x: True,
@@ -300,7 +300,7 @@ def test_function(data):
300300
def test_always_shrinks_to_none(a, seed, block_falsey, allow_sloppy):
301301
combined_strategy = st.one_of(st.none(), *a)
302302

303-
result, value = find_random(combined_strategy, lambda x: x is not None)
303+
result, _value = find_random(combined_strategy, lambda x: x is not None)
304304
shrunk_values = shrinks(
305305
combined_strategy, result.nodes, allow_sloppy=allow_sloppy, seed=seed
306306
)
@@ -317,11 +317,11 @@ def test_can_shrink_to_every_smaller_alternative(i, alts, seed, force_small):
317317
strats = [s for _, s in alts]
318318
combined_strategy = st.one_of(*strats)
319319
if force_small:
320-
result, value = precisely_shrink(
320+
result, _value = precisely_shrink(
321321
combined_strategy, is_interesting=lambda x: type(x) is types[i], seed=seed
322322
)
323323
else:
324-
result, value = find_random(
324+
result, _value = find_random(
325325
combined_strategy, lambda x: type(x) is types[i], seed=seed
326326
)
327327

hypothesis-python/tests/patching/test_patching.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_make_full_patch(tst, example, expected, body, remove):
168168

169169
@pytest.mark.parametrize("n", [0, 1, 2])
170170
def test_invalid_syntax_cases_dropped(n):
171-
tst, (ex, via), expected = SIMPLE
171+
tst, (ex, via), _expected = SIMPLE
172172
example_ls = [(ex.replace("x=1", f"x={x}"), via) for x in range(n)]
173173
example_ls.insert(-1, ("fn(\n x=<__main__.Cls object at 0x>,\n)", FAIL_MSG))
174174

0 commit comments

Comments
 (0)