Skip to content

Commit 1ff608e

Browse files
committed
fix rangetstep tests
1 parent 62a0e5e commit 1ff608e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/magicgui/widgets/_concrete.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,9 +519,9 @@ def __init__(
519519

520520
if self._value_type is range:
521521
if stop >= start:
522-
minstep, maxstep = builtins.max(1, abs(minstep)), 9999999
522+
minstep, maxstep = builtins.max(1, minstep), maxstep
523523
else:
524-
minstep, maxstep = -9999999, -builtins.min(1, abs(maxstep))
524+
minstep, maxstep = -maxstep, -builtins.min(1, abs(minstep))
525525
self.step = SpinBox(value=step, min=minstep, max=maxstep, name="step")
526526
self.start.changed.connect(self._emit_current_value)
527527
self.stop.changed.connect(self._emit_current_value)

tests/test_widgets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ def add(num1: int, num2: int) -> int:
463463
def test_range_widget():
464464
args = (-100, 1000, 2)
465465
rw = widgets.RangeEdit(*args)
466+
assert rw.step.min == 1
466467
v = rw.value
467468
assert isinstance(v, range)
468469
assert (v.start, v.stop, v.step) == args

0 commit comments

Comments
 (0)