From 44b066a3b22fd903400850901a32e39a5e38b282 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Fri, 13 Dec 2024 14:15:09 -0600 Subject: [PATCH 1/8] add slots to attribute-containing classes --- .../_watchdog_modules/expiration_state.py | 2 + generated/nidaqmx/system/system.py | 1 + generated/nidaqmx/system/watchdog.py | 2 + generated/nidaqmx/task/_export_signals.py | 2 + generated/nidaqmx/task/_in_stream.py | 2 + generated/nidaqmx/task/_out_stream.py | 2 + generated/nidaqmx/task/_task.py | 4 ++ generated/nidaqmx/task/_timing.py | 2 + .../task/triggering/_arm_start_trigger.py | 2 + .../task/triggering/_handshake_trigger.py | 2 + .../nidaqmx/task/triggering/_pause_trigger.py | 2 + .../task/triggering/_reference_trigger.py | 2 + .../nidaqmx/task/triggering/_start_trigger.py | 2 + .../nidaqmx/task/triggering/_triggers.py | 2 + .../expiration_state.py.mako | 2 + src/codegen/templates/system/system.py.mako | 1 + src/codegen/templates/system/watchdog.py.mako | 2 + .../templates/task/_export_signals.py.mako | 2 + src/codegen/templates/task/_in_stream.py.mako | 2 + .../templates/task/_out_stream.py.mako | 2 + src/codegen/templates/task/_timing.py.mako | 2 + .../triggering/_arm_start_trigger.py.mako | 2 + .../triggering/_handshake_trigger.py.mako | 2 + .../task/triggering/_pause_trigger.py.mako | 2 + .../triggering/_reference_trigger.py.mako | 2 + .../task/triggering/_start_trigger.py.mako | 2 + .../task/triggering/_triggers.py.mako | 2 + src/handwritten/task/_task.py | 4 ++ tests/component/system/test_system.py | 5 +++ tests/component/task/test_in_stream.py | 5 +++ tests/component/task/test_out_stream.py | 5 +++ tests/component/task/test_timing.py | 4 ++ .../task/test_triggers_properties.py | 30 +++++++++++++ tests/component/test_export_signals.py | 7 +++ tests/component/test_task.py | 12 ++++++ tests/component/test_task_properties.py | 5 +++ tests/component/test_watchdog.py | 43 +++++++++++++++++++ 37 files changed, 174 insertions(+) create mode 100644 tests/component/test_export_signals.py diff --git a/generated/nidaqmx/system/_watchdog_modules/expiration_state.py b/generated/nidaqmx/system/_watchdog_modules/expiration_state.py index 2ffa70d05..df6c10b62 100644 --- a/generated/nidaqmx/system/_watchdog_modules/expiration_state.py +++ b/generated/nidaqmx/system/_watchdog_modules/expiration_state.py @@ -10,6 +10,8 @@ class ExpirationState: """ Represents a DAQmx Watchdog expiration state. """ + __slots__ = ('_handle', '_physical_channel', '_interpreter') + def __init__(self, task_handle, physical_channel, interpreter): self._handle = task_handle self._physical_channel = physical_channel diff --git a/generated/nidaqmx/system/system.py b/generated/nidaqmx/system/system.py index c2489899b..99ed519b8 100644 --- a/generated/nidaqmx/system/system.py +++ b/generated/nidaqmx/system/system.py @@ -33,6 +33,7 @@ class System: operations on DAQ hardware, and creates classes from which you can get information about the hardware. """ + __slots__ = ('_interpreter') def __init__(self, grpc_options=None): """ diff --git a/generated/nidaqmx/system/watchdog.py b/generated/nidaqmx/system/watchdog.py index 09e4b8b57..99caa5c54 100644 --- a/generated/nidaqmx/system/watchdog.py +++ b/generated/nidaqmx/system/watchdog.py @@ -21,6 +21,8 @@ class WatchdogTask: """ Represents the watchdog configurations for a DAQmx task. """ + __slots__ = ('_handle', '_close_on_exit', '_saved_name', '_interpreter', '_expiration_states', '__weakref__') + def __init__(self, device_name, task_name='', timeout=10, grpc_options=None): """ Creates and configures a task that controls the watchdog timer of a diff --git a/generated/nidaqmx/task/_export_signals.py b/generated/nidaqmx/task/_export_signals.py index dc1104d54..47750a9f2 100644 --- a/generated/nidaqmx/task/_export_signals.py +++ b/generated/nidaqmx/task/_export_signals.py @@ -9,6 +9,8 @@ class ExportSignals: """ Represents the exported signal configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/_in_stream.py b/generated/nidaqmx/task/_in_stream.py index 29fa08017..7b87b310c 100644 --- a/generated/nidaqmx/task/_in_stream.py +++ b/generated/nidaqmx/task/_in_stream.py @@ -22,6 +22,8 @@ class InStream: used in conjunction with reader classes to read samples from an NI-DAQmx task. """ + __slots__ = ('_task', '_handle', '_interpreter', '_timeout') + def __init__(self, task, interpreter): self._task = task self._handle = task._handle diff --git a/generated/nidaqmx/task/_out_stream.py b/generated/nidaqmx/task/_out_stream.py index 7eea625dc..277f9541b 100644 --- a/generated/nidaqmx/task/_out_stream.py +++ b/generated/nidaqmx/task/_out_stream.py @@ -12,6 +12,8 @@ class OutStream: used in conjunction with writer classes to write samples to an NI-DAQmx task. """ + __slots__ = ('_task', '_handle', '_interpreter', '_auto_start', '_timeout') + def __init__(self, task, interpreter): self._task = task self._handle = task._handle diff --git a/generated/nidaqmx/task/_task.py b/generated/nidaqmx/task/_task.py index 498aa8059..af3fb1e1f 100644 --- a/generated/nidaqmx/task/_task.py +++ b/generated/nidaqmx/task/_task.py @@ -55,6 +55,10 @@ class Task: """ Represents a DAQmx Task. """ + __slots__ = ('_handle', '_close_on_exit', '_saved_name', '_grpc_options', '_event_handlers', '_interpreter', + '_ai_channels', '_ao_channels', '_ci_channels', '_co_channels', '_di_channels', '_do_channels', + '_export_signals', '_in_stream', '_timing', '_triggers', '_out_stream', '_event_handler_lock', + '__weakref__') def __init__(self, new_task_name='', *, grpc_options=None): """ diff --git a/generated/nidaqmx/task/_timing.py b/generated/nidaqmx/task/_timing.py index 23e3da0c5..6b443f1a2 100644 --- a/generated/nidaqmx/task/_timing.py +++ b/generated/nidaqmx/task/_timing.py @@ -12,6 +12,8 @@ class Timing: """ Represents the timing configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/triggering/_arm_start_trigger.py b/generated/nidaqmx/task/triggering/_arm_start_trigger.py index f7d56203e..cb2dbf01e 100644 --- a/generated/nidaqmx/task/triggering/_arm_start_trigger.py +++ b/generated/nidaqmx/task/triggering/_arm_start_trigger.py @@ -8,6 +8,8 @@ class ArmStartTrigger: """ Represents the arm start trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/triggering/_handshake_trigger.py b/generated/nidaqmx/task/triggering/_handshake_trigger.py index cdd3572f8..0701af7bc 100644 --- a/generated/nidaqmx/task/triggering/_handshake_trigger.py +++ b/generated/nidaqmx/task/triggering/_handshake_trigger.py @@ -8,6 +8,8 @@ class HandshakeTrigger: """ Represents the handshake trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/triggering/_pause_trigger.py b/generated/nidaqmx/task/triggering/_pause_trigger.py index 270c69bf7..51633871f 100644 --- a/generated/nidaqmx/task/triggering/_pause_trigger.py +++ b/generated/nidaqmx/task/triggering/_pause_trigger.py @@ -10,6 +10,8 @@ class PauseTrigger: """ Represents the pause trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/triggering/_reference_trigger.py b/generated/nidaqmx/task/triggering/_reference_trigger.py index 5bcfc3136..e253d5d96 100644 --- a/generated/nidaqmx/task/triggering/_reference_trigger.py +++ b/generated/nidaqmx/task/triggering/_reference_trigger.py @@ -12,6 +12,8 @@ class ReferenceTrigger: """ Represents the reference trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/triggering/_start_trigger.py b/generated/nidaqmx/task/triggering/_start_trigger.py index 416991273..e4288b897 100644 --- a/generated/nidaqmx/task/triggering/_start_trigger.py +++ b/generated/nidaqmx/task/triggering/_start_trigger.py @@ -13,6 +13,8 @@ class StartTrigger: """ Represents the start trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/generated/nidaqmx/task/triggering/_triggers.py b/generated/nidaqmx/task/triggering/_triggers.py index 374b3980c..914851f6f 100644 --- a/generated/nidaqmx/task/triggering/_triggers.py +++ b/generated/nidaqmx/task/triggering/_triggers.py @@ -13,6 +13,8 @@ class Triggers: """ Represents the trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter', '_arm_start_trigger', '_handshake_trigger', '_pause_trigger', '_reference_trigger', '_start_trigger') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/system/_watchdog_modules/expiration_state.py.mako b/src/codegen/templates/system/_watchdog_modules/expiration_state.py.mako index 238c70e78..6710d17d4 100644 --- a/src/codegen/templates/system/_watchdog_modules/expiration_state.py.mako +++ b/src/codegen/templates/system/_watchdog_modules/expiration_state.py.mako @@ -16,6 +16,8 @@ class ExpirationState: """ Represents a DAQmx Watchdog expiration state. """ + __slots__ = ('_handle', '_physical_channel', '_interpreter') + def __init__(self, task_handle, physical_channel, interpreter): self._handle = task_handle self._physical_channel = physical_channel diff --git a/src/codegen/templates/system/system.py.mako b/src/codegen/templates/system/system.py.mako index fe0e2487d..bfad15cf0 100644 --- a/src/codegen/templates/system/system.py.mako +++ b/src/codegen/templates/system/system.py.mako @@ -40,6 +40,7 @@ class System: operations on DAQ hardware, and creates classes from which you can get information about the hardware. """ + __slots__ = ('_interpreter') def __init__(self, grpc_options=None): """ diff --git a/src/codegen/templates/system/watchdog.py.mako b/src/codegen/templates/system/watchdog.py.mako index 8bd6edeeb..5c8c71b91 100644 --- a/src/codegen/templates/system/watchdog.py.mako +++ b/src/codegen/templates/system/watchdog.py.mako @@ -27,6 +27,8 @@ class WatchdogTask: """ Represents the watchdog configurations for a DAQmx task. """ + __slots__ = ('_handle', '_close_on_exit', '_saved_name', '_interpreter', '_expiration_states', '__weakref__') + def __init__(self, device_name, task_name='', timeout=10, grpc_options=None): """ Creates and configures a task that controls the watchdog timer of a diff --git a/src/codegen/templates/task/_export_signals.py.mako b/src/codegen/templates/task/_export_signals.py.mako index 1d44de16d..f71bf5ca0 100644 --- a/src/codegen/templates/task/_export_signals.py.mako +++ b/src/codegen/templates/task/_export_signals.py.mako @@ -21,6 +21,8 @@ class ExportSignals: """ Represents the exported signal configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/_in_stream.py.mako b/src/codegen/templates/task/_in_stream.py.mako index bd353a773..87e85f6c9 100644 --- a/src/codegen/templates/task/_in_stream.py.mako +++ b/src/codegen/templates/task/_in_stream.py.mako @@ -27,6 +27,8 @@ class InStream: used in conjunction with reader classes to read samples from an NI-DAQmx task. """ + __slots__ = ('_task', '_handle', '_interpreter', '_timeout') + def __init__(self, task, interpreter): self._task = task self._handle = task._handle diff --git a/src/codegen/templates/task/_out_stream.py.mako b/src/codegen/templates/task/_out_stream.py.mako index d3b1ed539..2fb5e8a22 100644 --- a/src/codegen/templates/task/_out_stream.py.mako +++ b/src/codegen/templates/task/_out_stream.py.mako @@ -18,6 +18,8 @@ class OutStream: used in conjunction with writer classes to write samples to an NI-DAQmx task. """ + __slots__ = ('_task', '_handle', '_interpreter', '_auto_start', '_timeout') + def __init__(self, task, interpreter): self._task = task self._handle = task._handle diff --git a/src/codegen/templates/task/_timing.py.mako b/src/codegen/templates/task/_timing.py.mako index b61c320a9..c0e817091 100644 --- a/src/codegen/templates/task/_timing.py.mako +++ b/src/codegen/templates/task/_timing.py.mako @@ -24,6 +24,8 @@ class Timing: """ Represents the timing configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako b/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako index e612846d7..d9a03d15e 100644 --- a/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_arm_start_trigger.py.mako @@ -22,6 +22,8 @@ class ArmStartTrigger: """ Represents the arm start trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/triggering/_handshake_trigger.py.mako b/src/codegen/templates/task/triggering/_handshake_trigger.py.mako index 77aed622f..21e9be9c8 100644 --- a/src/codegen/templates/task/triggering/_handshake_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_handshake_trigger.py.mako @@ -21,6 +21,8 @@ class HandshakeTrigger: """ Represents the handshake trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/triggering/_pause_trigger.py.mako b/src/codegen/templates/task/triggering/_pause_trigger.py.mako index 60d743a1d..b58093423 100644 --- a/src/codegen/templates/task/triggering/_pause_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_pause_trigger.py.mako @@ -22,6 +22,8 @@ class PauseTrigger: """ Represents the pause trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/triggering/_reference_trigger.py.mako b/src/codegen/templates/task/triggering/_reference_trigger.py.mako index 8c309d4b0..12e39916c 100644 --- a/src/codegen/templates/task/triggering/_reference_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_reference_trigger.py.mako @@ -24,6 +24,8 @@ class ReferenceTrigger: """ Represents the reference trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/triggering/_start_trigger.py.mako b/src/codegen/templates/task/triggering/_start_trigger.py.mako index d073c45e4..27de6128f 100644 --- a/src/codegen/templates/task/triggering/_start_trigger.py.mako +++ b/src/codegen/templates/task/triggering/_start_trigger.py.mako @@ -25,6 +25,8 @@ class StartTrigger: """ Represents the start trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/codegen/templates/task/triggering/_triggers.py.mako b/src/codegen/templates/task/triggering/_triggers.py.mako index b47f395ff..c40f77289 100644 --- a/src/codegen/templates/task/triggering/_triggers.py.mako +++ b/src/codegen/templates/task/triggering/_triggers.py.mako @@ -28,6 +28,8 @@ class Triggers: """ Represents the trigger configurations for a DAQmx task. """ + __slots__ = ('_handle', '_interpreter', '_arm_start_trigger', '_handshake_trigger', '_pause_trigger', '_reference_trigger', '_start_trigger') + def __init__(self, task_handle, interpreter): self._handle = task_handle self._interpreter = interpreter diff --git a/src/handwritten/task/_task.py b/src/handwritten/task/_task.py index 498aa8059..af3fb1e1f 100644 --- a/src/handwritten/task/_task.py +++ b/src/handwritten/task/_task.py @@ -55,6 +55,10 @@ class Task: """ Represents a DAQmx Task. """ + __slots__ = ('_handle', '_close_on_exit', '_saved_name', '_grpc_options', '_event_handlers', '_interpreter', + '_ai_channels', '_ao_channels', '_ci_channels', '_co_channels', '_di_channels', '_do_channels', + '_export_signals', '_in_stream', '_timing', '_triggers', '_out_stream', '_event_handler_lock', + '__weakref__') def __init__(self, new_task_name='', *, grpc_options=None): """ diff --git a/tests/component/system/test_system.py b/tests/component/system/test_system.py index 0640dbf55..ac69ac801 100644 --- a/tests/component/system/test_system.py +++ b/tests/component/system/test_system.py @@ -121,3 +121,8 @@ def test_invalid_power_up_states___set_analog_power_up_states___throws_invalid_a system.set_analog_power_up_states(device_name, power_up_states) assert exc_info.value.error_code == DAQmxErrors.INVALID_ATTRIBUTE_VALUE + + +def test___system___set_nonexistent_property___raises_exception(system): + with pytest.raises(AttributeError): + system.nonexistent_property = "foo" \ No newline at end of file diff --git a/tests/component/task/test_in_stream.py b/tests/component/task/test_in_stream.py index 277dba970..ddd388432 100644 --- a/tests/component/task/test_in_stream.py +++ b/tests/component/task/test_in_stream.py @@ -219,3 +219,8 @@ def test___valid_path___start_new_file___returns_assigned_value(ai_task: nidaqmx ai_task.in_stream.start_new_file(expected_file_path) assert ai_task.in_stream.logging_file_path == pathlib.Path(expected_file_path) + + +def test___in_stream___set_nonexistent_property___raises_exception(task: nidaqmx.Task): + with pytest.raises(AttributeError): + task.in_stream.nonexistent_property = "foo" diff --git a/tests/component/task/test_out_stream.py b/tests/component/task/test_out_stream.py index 07930455a..369e350f0 100644 --- a/tests/component/task/test_out_stream.py +++ b/tests/component/task/test_out_stream.py @@ -47,3 +47,8 @@ def test___odd_sized_array___write___returns_whole_samples( samples_written = task.out_stream.write(data) assert samples_written == 9 + + +def test___out_stream___set_nonexistent_property___raises_exception(task: nidaqmx.Task): + with pytest.raises(AttributeError): + task.out_stream.nonexistent_property = "foo" diff --git a/tests/component/task/test_timing.py b/tests/component/task/test_timing.py index b8e56bd42..521c31ea9 100644 --- a/tests/component/task/test_timing.py +++ b/tests/component/task/test_timing.py @@ -156,3 +156,7 @@ def test___timing___cfg_burst_handshaking_export_clock___sets_properties( sim_6535_di_single_line_task.export_signals.rdy_for_xfer_event_lvl_active_lvl == ready_event_active_level ) + +def test___timing___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.timing.nonexistent_property = "foo" \ No newline at end of file diff --git a/tests/component/task/test_triggers_properties.py b/tests/component/task/test_triggers_properties.py index f76182f23..363a456f3 100644 --- a/tests/component/task/test_triggers_properties.py +++ b/tests/component/task/test_triggers_properties.py @@ -160,3 +160,33 @@ def test___ai_voltage_time_aware_task___reset_timestamp_property___returns_defau assert when_value.hour == localized_default_value.hour assert when_value.minute == localized_default_value.minute assert when_value.second == localized_default_value.second + + +def test___trigger___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.triggers.nonexistent_property = "foo" + + +def test___arm_start_trigger___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.triggers.arm_start_trigger.nonexistent_property = "foo" + + +def test___handshake_trigger___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.triggers.handshake_trigger.nonexistent_property = "foo" + + +def test___pause_trigger___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.triggers.pause_trigger.nonexistent_property = "foo" + + +def test___reference_trigger___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.triggers.reference_trigger.nonexistent_property = "foo" + + +def test___start_trigger___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.triggers.start_trigger.nonexistent_property = "foo" \ No newline at end of file diff --git a/tests/component/test_export_signals.py b/tests/component/test_export_signals.py new file mode 100644 index 000000000..863efdc06 --- /dev/null +++ b/tests/component/test_export_signals.py @@ -0,0 +1,7 @@ +import pytest + +import nidaqmx + +def test___export_signals___set_nonexistent_property___raises_exception(task: nidaqmx.Task): + with pytest.raises(AttributeError): + task.export_signals.nonexistent_property = "foo" \ No newline at end of file diff --git a/tests/component/test_task.py b/tests/component/test_task.py index 78526319a..f72b0b852 100644 --- a/tests/component/test_task.py +++ b/tests/component/test_task.py @@ -1,4 +1,5 @@ import pytest +import weakref import nidaqmx import nidaqmx.system @@ -197,3 +198,14 @@ def test___task___add_global_channels___adds_to_channel_names(task: nidaqmx.Task task.add_global_channels([persisted_channel, persisted_channel2]) assert task.channel_names == [persisted_channel.name, persisted_channel2.name] + + +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" \ No newline at end of file diff --git a/tests/component/test_task_properties.py b/tests/component/test_task_properties.py index 674689027..5d767de5f 100644 --- a/tests/component/test_task_properties.py +++ b/tests/component/test_task_properties.py @@ -35,3 +35,8 @@ def test___get_devices___shared_interpreter(ai_task: Task): devices = ai_task.devices assert all(dev._interpreter is ai_task._interpreter for dev in devices) + + +def test___export_signals___set_nonexistent_property___raises_exception(task: Task): + with pytest.raises(AttributeError): + task.export_signals.nonexistent_property = "foo" diff --git a/tests/component/test_watchdog.py b/tests/component/test_watchdog.py index 4c92968e4..f0dd76d93 100644 --- a/tests/component/test_watchdog.py +++ b/tests/component/test_watchdog.py @@ -1,3 +1,6 @@ +import pytest +import weakref + from typing import Callable from nidaqmx.constants import WatchdogAOExpirState, WatchdogCOExpirState @@ -88,3 +91,43 @@ def test___watchdog_task___clear_expiration___no_error( watchdog_task.start() watchdog_task.clear_expiration() + + +def test___watchdog_task___create_weakref___succeeds( + generate_watchdog_task: Callable[..., WatchdogTask], + sim_9189_device: Device, +): + watchdog_task = generate_watchdog_task(f"{sim_9189_device.name}", timeout=0.8) + ref = weakref.ref(watchdog_task) + watchdog_task2 = ref() + assert watchdog_task is watchdog_task2 + + +def test___watchdog_task___set_nonexistent_property___raises_exception( + generate_watchdog_task: Callable[..., WatchdogTask], + sim_9189_device: Device, +): + watchdog_task = generate_watchdog_task(f"{sim_9189_device.name}", timeout=0.8) + + with pytest.raises(AttributeError): + watchdog_task.nonexistent_property = "foo" + + +def test___watchdog_expiration_states___set_nonexistent_property___raises_exception( + generate_watchdog_task: Callable[..., WatchdogTask], + sim_9189_device: Device, + sim_9263_device: Device, +): + watchdog_task = generate_watchdog_task(f"{sim_9189_device.name}", timeout=0.8) + expir_states = [ + AOExpirationState( + physical_channel=sim_9263_device.ao_physical_chans[0].name, + expiration_state=0.0, + output_type=WatchdogAOExpirState.VOLTAGE, + ) + ] + + watchdog_task.cfg_watchdog_ao_expir_states(expir_states) + + with pytest.raises(AttributeError): + watchdog_task.expiration_states[sim_9263_device.ao_physical_chans[0].name].nonexistent_property = "foo" \ No newline at end of file From cd04a04ab61ce35d03a6faece4b759aaeed13c46 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Fri, 13 Dec 2024 14:17:59 -0600 Subject: [PATCH 2/8] lint --- tests/component/system/test_system.py | 2 +- tests/component/task/test_timing.py | 3 ++- tests/component/task/test_triggers_properties.py | 2 +- tests/component/test_export_signals.py | 3 ++- tests/component/test_task.py | 5 +++-- tests/component/test_watchdog.py | 8 +++++--- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/component/system/test_system.py b/tests/component/system/test_system.py index ac69ac801..b5c24defb 100644 --- a/tests/component/system/test_system.py +++ b/tests/component/system/test_system.py @@ -125,4 +125,4 @@ def test_invalid_power_up_states___set_analog_power_up_states___throws_invalid_a def test___system___set_nonexistent_property___raises_exception(system): with pytest.raises(AttributeError): - system.nonexistent_property = "foo" \ No newline at end of file + system.nonexistent_property = "foo" diff --git a/tests/component/task/test_timing.py b/tests/component/task/test_timing.py index 521c31ea9..f7708960d 100644 --- a/tests/component/task/test_timing.py +++ b/tests/component/task/test_timing.py @@ -157,6 +157,7 @@ def test___timing___cfg_burst_handshaking_export_clock___sets_properties( == ready_event_active_level ) + def test___timing___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.timing.nonexistent_property = "foo" \ No newline at end of file + task.timing.nonexistent_property = "foo" diff --git a/tests/component/task/test_triggers_properties.py b/tests/component/task/test_triggers_properties.py index 363a456f3..e284ae8fd 100644 --- a/tests/component/task/test_triggers_properties.py +++ b/tests/component/task/test_triggers_properties.py @@ -189,4 +189,4 @@ def test___reference_trigger___set_nonexistent_property___raises_exception(task: def test___start_trigger___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.triggers.start_trigger.nonexistent_property = "foo" \ No newline at end of file + task.triggers.start_trigger.nonexistent_property = "foo" diff --git a/tests/component/test_export_signals.py b/tests/component/test_export_signals.py index 863efdc06..355a29c8e 100644 --- a/tests/component/test_export_signals.py +++ b/tests/component/test_export_signals.py @@ -2,6 +2,7 @@ import nidaqmx + def test___export_signals___set_nonexistent_property___raises_exception(task: nidaqmx.Task): with pytest.raises(AttributeError): - task.export_signals.nonexistent_property = "foo" \ No newline at end of file + task.export_signals.nonexistent_property = "foo" diff --git a/tests/component/test_task.py b/tests/component/test_task.py index f72b0b852..f7fcfa6b6 100644 --- a/tests/component/test_task.py +++ b/tests/component/test_task.py @@ -1,6 +1,7 @@ -import pytest import weakref +import pytest + import nidaqmx import nidaqmx.system from nidaqmx.constants import ShuntCalSelect, ShuntCalSource, ShuntElementLocation @@ -208,4 +209,4 @@ def test___task___create_weakref___succeeds(task: nidaqmx.Task): def test___task___set_nonexistent_property___raises_exception(task: nidaqmx.Task): with pytest.raises(AttributeError): - task.nonexistent_property = "foo" \ No newline at end of file + task.nonexistent_property = "foo" diff --git a/tests/component/test_watchdog.py b/tests/component/test_watchdog.py index f0dd76d93..1284a1200 100644 --- a/tests/component/test_watchdog.py +++ b/tests/component/test_watchdog.py @@ -1,8 +1,8 @@ -import pytest import weakref - from typing import Callable +import pytest + from nidaqmx.constants import WatchdogAOExpirState, WatchdogCOExpirState from nidaqmx.system import Device from nidaqmx.system.watchdog import AOExpirationState, COExpirationState, WatchdogTask @@ -130,4 +130,6 @@ def test___watchdog_expiration_states___set_nonexistent_property___raises_except watchdog_task.cfg_watchdog_ao_expir_states(expir_states) with pytest.raises(AttributeError): - watchdog_task.expiration_states[sim_9263_device.ao_physical_chans[0].name].nonexistent_property = "foo" \ No newline at end of file + watchdog_task.expiration_states[ + sim_9263_device.ao_physical_chans[0].name + ].nonexistent_property = "foo" From b367db4928d9c03977ccfc13c6f6e000967f2e74 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Fri, 13 Dec 2024 14:21:39 -0600 Subject: [PATCH 3/8] 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 ddd388432..603c76e4b 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 369e350f0..c35196f4e 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 f7708960d..084edfd25 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 e284ae8fd..1af2a2b98 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 355a29c8e..99bdb5cd7 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 f7fcfa6b6..811eb16eb 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 5d767de5f..4d885e2c5 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 1284a1200..aa5b071b6 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] From 640a7055836c4d8a08595e272e9daec0ca25e9b2 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Fri, 13 Dec 2024 14:23:25 -0600 Subject: [PATCH 4/8] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15b1cba3b..4269ee9f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ All notable changes to this project will be documented in this file. * ... * ### Resolved Issues - * ... + * [656: Missing usage of slots in classes with DAQmx attributes](https://github.com/ni/nidaqmx-python/issues/656) * ### Major Changes * Added support for mioDAQ configurable digital voltage. From a7f0811364f5b7ce2885b9ccbe35482978e96fa7 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Fri, 13 Dec 2024 14:28:31 -0600 Subject: [PATCH 5/8] lint2 --- 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_properties.py | 2 +- tests/component/test_watchdog.py | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/component/task/test_in_stream.py b/tests/component/task/test_in_stream.py index 603c76e4b..2d045eee8 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" # type: ignore[attr-defined] + 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 c35196f4e..dffbc8101 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" # type: ignore[attr-defined] + 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 084edfd25..92ce6b6ed 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" # type: ignore[attr-defined] + 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 1af2a2b98..38fa71179 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" # type: ignore[attr-defined] + 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" # type: ignore[attr-defined] + 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" # type: ignore[attr-defined] + 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" # type: ignore[attr-defined] + 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" # type: ignore[attr-defined] + 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" # type: ignore[attr-defined] + 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 99bdb5cd7..1e64a5c81 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" # type: ignore[attr-defined] + task.export_signals.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/test_task_properties.py b/tests/component/test_task_properties.py index 4d885e2c5..e8e2564bd 100644 --- a/tests/component/test_task_properties.py +++ b/tests/component/test_task_properties.py @@ -39,4 +39,4 @@ def test___get_devices___shared_interpreter(ai_task: Task): def test___task___set_nonexistent_property___raises_exception(task: Task): with pytest.raises(AttributeError): - task.nonexistent_property = "foo" # type: ignore[attr-defined] + task.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/test_watchdog.py b/tests/component/test_watchdog.py index aa5b071b6..d9bf15b23 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" # type: ignore[attr-defined] + 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" # type: ignore[attr-defined] + ].nonexistent_property = "foo" # type: ignore[attr-defined] From df50442864260808e4263bcf3fd1271bab8f3439 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Tue, 17 Dec 2024 14:43:31 -0600 Subject: [PATCH 6/8] code review --- tests/component/system/test_system.py | 4 ++-- tests/component/test_watchdog.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/component/system/test_system.py b/tests/component/system/test_system.py index b5c24defb..fe3dcf789 100644 --- a/tests/component/system/test_system.py +++ b/tests/component/system/test_system.py @@ -123,6 +123,6 @@ def test_invalid_power_up_states___set_analog_power_up_states___throws_invalid_a assert exc_info.value.error_code == DAQmxErrors.INVALID_ATTRIBUTE_VALUE -def test___system___set_nonexistent_property___raises_exception(system): +def test___system___set_nonexistent_property___raises_exception(system: nidaqmx.system.System): with pytest.raises(AttributeError): - system.nonexistent_property = "foo" + system.nonexistent_property = "foo" # type: ignore[attr-defined] diff --git a/tests/component/test_watchdog.py b/tests/component/test_watchdog.py index d9bf15b23..72efd0cfd 100644 --- a/tests/component/test_watchdog.py +++ b/tests/component/test_watchdog.py @@ -126,7 +126,6 @@ def test___watchdog_expiration_states___set_nonexistent_property___raises_except output_type=WatchdogAOExpirState.VOLTAGE, ) ] - watchdog_task.cfg_watchdog_ao_expir_states(expir_states) with pytest.raises(AttributeError): From 8ebd5f8611ce94d841a36cd56370dd0e2ca16d6b Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Tue, 17 Dec 2024 15:06:04 -0600 Subject: [PATCH 7/8] cleanup --- tests/component/system/test_system.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/component/system/test_system.py b/tests/component/system/test_system.py index fe3dcf789..2d59d7c44 100644 --- a/tests/component/system/test_system.py +++ b/tests/component/system/test_system.py @@ -6,6 +6,7 @@ from nidaqmx.constants import PowerUpChannelType from nidaqmx.error_codes import DAQmxErrors from nidaqmx.types import AOPowerUpState +from nidaqmx.system import System def test___get_analog_power_up_states_with_output_type___returns_power_up_states(system): @@ -123,6 +124,6 @@ def test_invalid_power_up_states___set_analog_power_up_states___throws_invalid_a assert exc_info.value.error_code == DAQmxErrors.INVALID_ATTRIBUTE_VALUE -def test___system___set_nonexistent_property___raises_exception(system: nidaqmx.system.System): +def test___system___set_nonexistent_property___raises_exception(system: System): with pytest.raises(AttributeError): system.nonexistent_property = "foo" # type: ignore[attr-defined] From 0eb769efd148cf6f5875d0b56a18be084305cc13 Mon Sep 17 00:00:00 2001 From: Zach Hindes Date: Tue, 17 Dec 2024 15:08:54 -0600 Subject: [PATCH 8/8] arg --- tests/component/system/test_system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/component/system/test_system.py b/tests/component/system/test_system.py index 2d59d7c44..7c9b8b799 100644 --- a/tests/component/system/test_system.py +++ b/tests/component/system/test_system.py @@ -5,8 +5,8 @@ import nidaqmx from nidaqmx.constants import PowerUpChannelType from nidaqmx.error_codes import DAQmxErrors -from nidaqmx.types import AOPowerUpState from nidaqmx.system import System +from nidaqmx.types import AOPowerUpState def test___get_analog_power_up_states_with_output_type___returns_power_up_states(system):