From b367db4928d9c03977ccfc13c6f6e000967f2e74 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Fri, 13 Dec 2024 14:21:39 -0600 Subject: [PATCH] mypy --- tests/component/task/test_in_stream.py | 2 +- tests/component/task/test_out_stream.py | 2 +- tests/component/task/test_timing.py | 2 +- tests/component/task/test_triggers_properties.py | 12 ++++++------ tests/component/test_export_signals.py | 2 +- tests/component/test_task.py | 5 ----- tests/component/test_task_properties.py | 4 ++-- tests/component/test_watchdog.py | 4 ++-- 8 files changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/component/task/test_in_stream.py b/tests/component/task/test_in_stream.py index ddd38843..603c76e4 100644 --- a/tests/component/task/test_in_stream.py +++ b/tests/component/task/test_in_stream.py @@ -223,4 +223,4 @@ def test___valid_path___start_new_file___returns_assigned_value(ai_task: nidaqmx def test___in_stream___set_nonexistent_property___raises_exception(task: nidaqmx.Task): with pytest.raises(AttributeError): - task.in_stream.nonexistent_property = "foo" + task.in_stream.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/task/test_out_stream.py b/tests/component/task/test_out_stream.py index 369e350f..c35196f4 100644 --- a/tests/component/task/test_out_stream.py +++ b/tests/component/task/test_out_stream.py @@ -51,4 +51,4 @@ def test___odd_sized_array___write___returns_whole_samples( def test___out_stream___set_nonexistent_property___raises_exception(task: nidaqmx.Task): with pytest.raises(AttributeError): - task.out_stream.nonexistent_property = "foo" + task.out_stream.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/task/test_timing.py b/tests/component/task/test_timing.py index f7708960..084edfd2 100644 --- a/tests/component/task/test_timing.py +++ b/tests/component/task/test_timing.py @@ -160,4 +160,4 @@ def test___timing___cfg_burst_handshaking_export_clock___sets_properties( def test___timing___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.timing.nonexistent_property = "foo" + task.timing.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/task/test_triggers_properties.py b/tests/component/task/test_triggers_properties.py index e284ae8f..1af2a2b9 100644 --- a/tests/component/task/test_triggers_properties.py +++ b/tests/component/task/test_triggers_properties.py @@ -164,29 +164,29 @@ def test___ai_voltage_time_aware_task___reset_timestamp_property___returns_defau def test___trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.nonexistent_property = "foo" + task.triggers.nonexistent_property = "foo" # type: ignore[attr-defined] def test___arm_start_trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.arm_start_trigger.nonexistent_property = "foo" + task.triggers.arm_start_trigger.nonexistent_property = "foo" # type: ignore[attr-defined] def test___handshake_trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.handshake_trigger.nonexistent_property = "foo" + task.triggers.handshake_trigger.nonexistent_property = "foo" # type: ignore[attr-defined] def test___pause_trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.pause_trigger.nonexistent_property = "foo" + task.triggers.pause_trigger.nonexistent_property = "foo" # type: ignore[attr-defined] def test___reference_trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.reference_trigger.nonexistent_property = "foo" + task.triggers.reference_trigger.nonexistent_property = "foo" # type: ignore[attr-defined] def test___start_trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.start_trigger.nonexistent_property = "foo" + task.triggers.start_trigger.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/test_export_signals.py b/tests/component/test_export_signals.py index 355a29c8..99bdb5cd 100644 --- a/tests/component/test_export_signals.py +++ b/tests/component/test_export_signals.py @@ -5,4 +5,4 @@ def test___export_signals___set_nonexistent_property___raises_exception(task: nidaqmx.Task): with pytest.raises(AttributeError): - task.export_signals.nonexistent_property = "foo" + task.export_signals.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/test_task.py b/tests/component/test_task.py index f7fcfa6b..811eb16e 100644 --- a/tests/component/test_task.py +++ b/tests/component/test_task.py @@ -205,8 +205,3 @@ def test___task___create_weakref___succeeds(task: nidaqmx.Task): ref = weakref.ref(task) task2 = ref() assert task is task2 - - -def test___task___set_nonexistent_property___raises_exception(task: nidaqmx.Task): - with pytest.raises(AttributeError): - task.nonexistent_property = "foo" diff --git a/tests/component/test_task_properties.py b/tests/component/test_task_properties.py index 5d767de5..4d885e2c 100644 --- a/tests/component/test_task_properties.py +++ b/tests/component/test_task_properties.py @@ -37,6 +37,6 @@ def test___get_devices___shared_interpreter(ai_task: Task): assert all(dev._interpreter is ai_task._interpreter for dev in devices) -def test___export_signals___set_nonexistent_property___raises_exception(task: Task): +def test___task___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.export_signals.nonexistent_property = "foo" + task.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/test_watchdog.py b/tests/component/test_watchdog.py index 1284a120..aa5b071b 100644 --- a/tests/component/test_watchdog.py +++ b/tests/component/test_watchdog.py @@ -110,7 +110,7 @@ def test___watchdog_task___set_nonexistent_property___raises_exception( watchdog_task = generate_watchdog_task(f"{sim_9189_device.name}", timeout=0.8) with pytest.raises(AttributeError): - watchdog_task.nonexistent_property = "foo" + watchdog_task.nonexistent_property = "foo" # type: ignore[attr-defined] def test___watchdog_expiration_states___set_nonexistent_property___raises_exception( @@ -132,4 +132,4 @@ def test___watchdog_expiration_states___set_nonexistent_property___raises_except with pytest.raises(AttributeError): watchdog_task.expiration_states[ sim_9263_device.ao_physical_chans[0].name - ].nonexistent_property = "foo" + ].nonexistent_property = "foo" # type: ignore[attr-defined]