Skip to content

Commit a50735d

Browse files
committed
fix(reduce): disable lithium repeat last feature
Set this in the correct place this time.
1 parent bb8745d commit a50735d

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

src/grizzly/reduce/strategies/lithium.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def __init__(self, testcases: list[TestCase]) -> None:
4848
testcases.
4949
"""
5050
super().__init__(testcases)
51-
self.minimize_repeat = "never"
5251
self._current_feedback: bool | None = None
5352
self._current_reducer: ReductionIterator | None = None
5453
self._files_to_reduce: list[Path] = []
@@ -118,6 +117,7 @@ def __iter__(self) -> Generator[list[TestCase]]:
118117
lithium_testcase = self.testcase_cls() # pylint: disable=not-callable
119118
lithium_testcase.load(file)
120119
strategy = self.strategy_cls() # pylint: disable=not-callable
120+
strategy.minimize_repeat = "never" # type: ignore[attr-defined]
121121
self._current_reducer = strategy.reduce(lithium_testcase)
122122

123123
# Populate the lithium strategy "tried" cache.

src/grizzly/reduce/test_reduce.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""Unit tests for `grizzly.reduce.reduce`."""
66

77
from collections import namedtuple
8-
from functools import partial, wraps
8+
from functools import wraps
99
from itertools import count
1010
from logging import getLogger
1111
from pathlib import Path
@@ -430,7 +430,7 @@ def wrapped(_):
430430
detect_failure=lambda contents: set(contents.splitlines()) >= set("135"),
431431
interesting_str="%r contains {'1', '3', '5'}",
432432
is_expected=lambda contents: contents != "1\n3\n5\n",
433-
expected_run_calls=13,
433+
expected_run_calls=12,
434434
n_reports=2,
435435
reports={"1\n2\n3\n4\n5\n6\n", "1\n2\n3\n5\n"},
436436
n_other=1,
@@ -468,7 +468,7 @@ def wrapped(_):
468468
),
469469
interesting_str="%r contains {'A1\\n', 'A3\\n', 'A5\\n'}",
470470
is_expected=lambda _: True,
471-
expected_run_calls=34,
471+
expected_run_calls=32,
472472
# lines found nothing, only check and chars should report
473473
n_reports=2,
474474
reports={"A1\nA2\nA3\nA4\nA5\nA6\n", "A1\nA3\nA5\n"},
@@ -507,22 +507,6 @@ def wrapped(_):
507507
other_reports=None,
508508
result=0,
509509
),
510-
# reproduces, two strategies, 1st no reduce, 2nd testcase reduces to 0
511-
ReproTestParams(
512-
original=b"1\n2\n3\n",
513-
strategies=["check", "lines", "lines"],
514-
detect_failure=_ignore_arg(
515-
partial([True, False, False, False, False, True, True, True].pop, 0)
516-
),
517-
interesting_str="%r is anything, only in second strategy",
518-
is_expected=lambda _: True,
519-
expected_run_calls=8,
520-
n_reports=2,
521-
reports={"1\n2\n3\n", ""},
522-
n_other=0,
523-
other_reports=None,
524-
result=0,
525-
),
526510
],
527511
)
528512
@mark.usefixtures("reporter_sequential_strftime")

src/grizzly/reduce/test_strategies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def replay_run(testcases, _time_limit, **kw):
240240
) as mgr:
241241
assert mgr.run() == 0
242242

243-
expected_run_calls = 3
243+
expected_run_calls = 2
244244
expected_results = {"DDBEGIN\nrequired\nDDEND\n"}
245245
expected_num_reports = 2
246246

0 commit comments

Comments
 (0)