Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ repos:
- id: check-yaml
- id: debug-statements
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.10.0
rev: 26.10.1
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
rev: v3.22.0
hooks:
- id: pyupgrade
args: [ --py39-plus ]
18 changes: 9 additions & 9 deletions tests/test_tektronix/test_tekdpo70000.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_data_source_name():
assert inst.channel[channel].name == f"CH{channel+1}"


@pytest.mark.parametrize("channel", [it for it in range(4)])
@pytest.mark.parametrize("channel", [*range(4)])
@given(
values=st.lists(
st.integers(min_value=-2147483648, max_value=2147483647), min_size=1
Expand Down Expand Up @@ -223,15 +223,15 @@ def test_data_source_read_waveform_with_old_data_source():
# MATH #


@pytest.mark.parametrize("math", [it for it in range(4)])
@pytest.mark.parametrize("math", [*range(4)])
def test_math_init(math):
"""Initialize a math channel."""
with expected_protocol(ik.tektronix.TekDPO70000, [], []) as inst:
assert inst.math[math]._parent is inst
assert inst.math[math]._idx == math + 1


@pytest.mark.parametrize("math", [it for it in range(4)])
@pytest.mark.parametrize("math", [*range(4)])
def test_math_sendcmd(math):
"""Send a command from a math channel."""
cmd = "TEST"
Expand All @@ -241,7 +241,7 @@ def test_math_sendcmd(math):
inst.math[math].sendcmd(cmd)


@pytest.mark.parametrize("math", [it for it in range(4)])
@pytest.mark.parametrize("math", [*range(4)])
def test_math_query(math):
"""Query from a math channel."""
cmd = "TEST"
Expand Down Expand Up @@ -711,15 +711,15 @@ def test_math_scale_raw_data(values):
# CHANNEL #


@pytest.mark.parametrize("channel", [it for it in range(4)])
@pytest.mark.parametrize("channel", [*range(4)])
def test_channel_init(channel):
"""Initialize a channel."""
with expected_protocol(ik.tektronix.TekDPO70000, [], []) as inst:
assert inst.channel[channel]._parent is inst
assert inst.channel[channel]._idx == channel + 1


@pytest.mark.parametrize("channel", [it for it in range(4)])
@pytest.mark.parametrize("channel", [*range(4)])
def test_channel_sendcmd(channel):
"""Send a command from a channel."""
cmd = "TEST"
Expand All @@ -729,7 +729,7 @@ def test_channel_sendcmd(channel):
inst.channel[channel].sendcmd(cmd)


@pytest.mark.parametrize("channel", [it for it in range(4)])
@pytest.mark.parametrize("channel", [*range(4)])
def test_channel_query(channel):
"""Send a query from a channel."""
cmd = "TEST"
Expand Down Expand Up @@ -1188,7 +1188,7 @@ def test_data_sync_sources(value):
assert inst.data_sync_sources == value


valid_channel_range = [it for it in range(4)]
valid_channel_range = [*range(4)]


@pytest.mark.parametrize("no", valid_channel_range)
Expand All @@ -1205,7 +1205,7 @@ def test_data_source_channel(no):
assert inst.data_source == channel


valid_math_range = [it for it in range(4)]
valid_math_range = [*range(4)]


@pytest.mark.parametrize("no", valid_math_range)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_tektronix/test_tktds5xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# MEASUREMENT #


@pytest.mark.parametrize("msr", [it for it in range(3)])
@pytest.mark.parametrize("msr", [*range(3)])
def test_measurement_init(msr):
"""Initialize a new measurement."""
meas_categories = [
Expand All @@ -61,7 +61,7 @@ def test_measurement_init(msr):
assert measurement._data == data_expected


@pytest.mark.parametrize("msr", [it for it in range(3)])
@pytest.mark.parametrize("msr", [*range(3)])
@given(value=st.floats(allow_nan=False))
def test_measurement_read_enabled_true(msr, value):
"""Read a new measurement value since enabled is true."""
Expand Down Expand Up @@ -231,7 +231,7 @@ def test_data_source_read_waveform_ascii(values):
# CHANNEL #


@pytest.mark.parametrize("channel", [it for it in range(4)])
@pytest.mark.parametrize("channel", [*range(4)])
def test_channel_init(channel):
"""Initialize a new channel."""
with expected_protocol(ik.tektronix.TekTDS5xx, [], []) as inst:
Expand Down Expand Up @@ -402,7 +402,7 @@ def test_sources(states):
assert active_read == active_sources


@pytest.mark.parametrize("channel", [it for it in range(4)])
@pytest.mark.parametrize("channel", [*range(4)])
def test_data_source_channel(channel):
"""Get / set channel data source for waveform transfer."""
with expected_protocol(
Expand All @@ -418,7 +418,7 @@ def test_data_source_channel(channel):
assert inst.data_source == data_source


@pytest.mark.parametrize("channel", [it for it in range(3)])
@pytest.mark.parametrize("channel", [*range(3)])
def test_data_source_math(channel):
"""Get / set math data source for waveform transfer."""
with expected_protocol(
Expand All @@ -434,7 +434,7 @@ def test_data_source_math(channel):
assert inst.data_source == data_source


@pytest.mark.parametrize("channel", [it for it in range(3)])
@pytest.mark.parametrize("channel", [*range(3)])
def test_data_source_ref(channel):
"""Get / set ref data source for waveform transfer."""
with expected_protocol(
Expand Down
Loading