Skip to content

Commit

Permalink
Remove all grpc_xfail for AB#2393811 and requiring newer gRPC Device … (
Browse files Browse the repository at this point in the history
#617)

* Remove all grpc_xfail for AB#2393811 and requiring newer gRPC Device Server

* Updates for linting errors
  • Loading branch information
texasaggie97 authored Jul 18, 2024
1 parent 3a990c6 commit 19a9d47
Show file tree
Hide file tree
Showing 13 changed files with 1 addition and 127 deletions.
12 changes: 0 additions & 12 deletions tests/acceptance/test_internationalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ def test___supported_encoding___reset_nonexistent_device___returns_error_with_de
assert exc_info.value.error_code == DAQmxErrors.INVALID_DEVICE_ID


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
@pytest.mark.parametrize(
"file_path, supported_encodings",
[
Expand All @@ -71,10 +67,6 @@ def test___supported_encoding___logging_file_path___returns_assigned_value(
assert ai_task.in_stream.logging_file_path == pathlib.Path(file_path)


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
@pytest.mark.parametrize(
"file_path, supported_encodings",
[
Expand All @@ -96,10 +88,6 @@ def test___supported_encoding___configure_logging___returns_assigned_values(
assert ai_task.in_stream.logging_file_path == pathlib.Path(file_path)


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
@pytest.mark.parametrize(
"file_path, supported_encodings",
[
Expand Down
4 changes: 0 additions & 4 deletions tests/acceptance/test_multi_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from nidaqmx import Task
from nidaqmx.constants import AcquisitionType
from nidaqmx.errors import RpcError
from nidaqmx.system import Device, System
from nidaqmx.task.channels import AIChannel
from tests.helpers import generate_random_seed
Expand Down Expand Up @@ -201,9 +200,6 @@ def test___shared_interpreter___run_multiple_acquisitions_with_events___callback
assert all(status == 0 for status in done_statuses)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___shared_interpreter___unregister_events_during_other_acquisitions_with_events___callbacks_invoked(
init_kwargs,
multi_threading_test_devices: Sequence[Device],
Expand Down
6 changes: 0 additions & 6 deletions tests/component/system/test_device.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import pytest

from nidaqmx.errors import RpcError
from nidaqmx.system import Device


Expand Down Expand Up @@ -38,9 +35,6 @@ def test___self_test_device___no_errors(sim_6363_device: Device) -> None:
sim_6363_device.self_test_device()


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
def test___restore_last_ext_cal_const___no_errors(sim_6363_device: Device) -> None:
sim_6363_device.restore_last_ext_cal_const()

Expand Down
4 changes: 0 additions & 4 deletions tests/component/system/test_device_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ def test___device___list_of_float_property___returns_value(device):
assert ai_bridge_ranges == [-0.025, 0.025, -0.1, 0.1]


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later",
raises=DaqError,
)
@pytest.mark.device_name("bridgeTester")
def test___device___list_of_enum_property___returns_value(device):
ai_trigger_usage = device.ai_trig_usage
Expand Down
1 change: 0 additions & 1 deletion tests/component/system/test_physical_channel_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def test___physical_channel_with_teds___get_bit_stream___returns_configured_valu
assert (phys_chan.teds_bit_stream == expected_value).all()


@pytest.mark.grpc_xfail(reason="Requires NI gRPC Device Server version 2.2 or later")
def test___physical_channel___get_int32_array_property___returns_default_value(
sim_6363_device,
):
Expand Down
9 changes: 0 additions & 9 deletions tests/component/task/test_in_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import nidaqmx
import nidaqmx.system
from nidaqmx.constants import AcquisitionType, LoggingMode, LoggingOperation
from nidaqmx.errors import DaqError

# With a simulated X Series, setting ai_max/min to +/-2.5 V coerces the hardware range
# to +/-5 V and generates a noisy sine wave with range +/-2.5 V (raw: about +/-16383).
Expand Down Expand Up @@ -196,10 +195,6 @@ def test___odd_sized_array___read_into___returns_whole_samples_and_clears_paddin
assert data[-1] == 0 # not FULLSCALE_RAW_MIN


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
def test___valid_path___configure_logging___returns_assigned_values(ai_task: nidaqmx.Task):
expected_file_path = "Testing File.tdms"
expected_group_name = "Task"
Expand All @@ -219,10 +214,6 @@ def test___valid_path___configure_logging___returns_assigned_values(ai_task: nid
assert ai_task.in_stream.logging_tdms_operation == expected_logging_operation


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
def test___valid_path___start_new_file___returns_assigned_value(ai_task: nidaqmx.Task):
expected_file_path = "Testing File.tdms"
ai_task.in_stream.start_new_file(expected_file_path)
Expand Down
17 changes: 0 additions & 17 deletions tests/component/task/test_in_stream_read_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest

from nidaqmx.constants import OverwriteMode, ReadRelativeTo
from nidaqmx.errors import DaqError
from nidaqmx.task import Task


Expand Down Expand Up @@ -123,38 +122,22 @@ def test___ai_task___reset_bool_property___returns_default_value(ai_task: Task):
assert not ai_task.in_stream.logging_pause


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
def test___ai_task___get_string_property___returns_default_value(ai_task: Task):
assert ai_task.in_stream.logging_file_path is None


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
def test___ai_task___set_string_property___returns_assigned_value(ai_task: Task):
ai_task.in_stream.logging_file_path = "TestData.tdms" # type: ignore[assignment] # https://github.com/ni/nidaqmx-python/issues/613

assert ai_task.in_stream.logging_file_path == pathlib.Path("TestData.tdms")


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
def test___ai_task___set_string_property_none___returns_default_value(ai_task: Task):
ai_task.in_stream.logging_file_path = None

assert ai_task.in_stream.logging_file_path is None


@pytest.mark.grpc_xfail(
reason="AB#2393811: DAQmxGetLoggingFilePath returns kErrorNULLPtr (-200604) when called from grpc-device.",
raises=DaqError,
)
def test___ai_task___reset_string_property___returns_default_value(ai_task: Task):
ai_task.in_stream.logging_file_path = "TestData.tdms" # type: ignore[assignment] # https://github.com/ni/nidaqmx-python/issues/613

Expand Down
25 changes: 0 additions & 25 deletions tests/component/test_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import nidaqmx.system
from nidaqmx.constants import ShuntCalSelect, ShuntCalSource, ShuntElementLocation
from nidaqmx.error_codes import DAQmxErrors
from nidaqmx.errors import RpcError
from nidaqmx.system.storage import PersistedChannel


Expand Down Expand Up @@ -61,9 +60,6 @@ def test___tasks_with_different_names___hash___not_equal(generate_task):
assert hash(task1) != hash(task2)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
@pytest.mark.device_name("bridgeTester")
@pytest.mark.parametrize("skip_unsupported_channels", [True, False])
def test___arguments_specified___perform_bridge_offset_nulling_cal___no_errors(
Expand All @@ -74,9 +70,6 @@ def test___arguments_specified___perform_bridge_offset_nulling_cal___no_errors(
)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
@pytest.mark.device_name("bridgeTester")
def test___default_arguments___perform_bridge_offset_nulling_cal___no_errors(
ai_bridge_task: nidaqmx.Task,
Expand All @@ -85,9 +78,6 @@ def test___default_arguments___perform_bridge_offset_nulling_cal___no_errors(


@pytest.mark.device_name("bridgeTester")
@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
@pytest.mark.parametrize(
"shunt_resistor_value, shunt_resistor_location, shunt_resistor_select, shunt_resistor_source, bridge_resistance, skip_unsupported_channels",
[
Expand Down Expand Up @@ -122,9 +112,6 @@ def test___perform_bridge_shunt_cal___no_errors(


@pytest.mark.device_name("bridgeTester")
@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
def test___perform_bridge_shunt_cal_default___no_errors(
ai_bridge_task: nidaqmx.Task,
) -> None:
Expand All @@ -136,9 +123,6 @@ def test___perform_bridge_shunt_cal_default___no_errors(


@pytest.mark.device_name("bridgeTester")
@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
@pytest.mark.parametrize(
"shunt_resistor_value, shunt_resistor_location, shunt_resistor_select, shunt_resistor_source, skip_unsupported_channels",
[
Expand Down Expand Up @@ -171,9 +155,6 @@ def test___perform_strain_shunt_cal___no_errors(


@pytest.mark.device_name("bridgeTester")
@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
def test___perform_strain_shunt_cal_default___no_errors(
ai_strain_gage_task: nidaqmx.Task,
) -> None:
Expand All @@ -184,9 +165,6 @@ def test___perform_strain_shunt_cal_default___no_errors(
raise


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
@pytest.mark.device_name("cDAQ1Mod2")
@pytest.mark.parametrize("skip_unsupported_channels", [True, False])
def test___arguments_specified___perform_thrmcpl_lead_offset_nulling_cal___no_errors(
Expand All @@ -197,9 +175,6 @@ def test___arguments_specified___perform_thrmcpl_lead_offset_nulling_cal___no_er
)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.5 or later", raises=RpcError
)
@pytest.mark.device_name("cDAQ1Mod2")
def test___default_arguments___perform_thrmcpl_lead_offset_nulling_cal___no_errors(
ai_thermocouple_task: nidaqmx.Task,
Expand Down
36 changes: 1 addition & 35 deletions tests/component/test_task_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import nidaqmx.system
from nidaqmx.constants import AcquisitionType, EveryNSamplesEventType, Signal
from nidaqmx.error_codes import DAQmxErrors
from nidaqmx.errors import DaqResourceWarning, RpcError
from nidaqmx.errors import DaqResourceWarning
from nidaqmx.task import _TaskEventType
from tests._event_utils import (
DoneEventObserver,
Expand Down Expand Up @@ -212,9 +212,6 @@ def test___signal_event_registered___run_finite_acquisition___callback_invoked_n
assert all(e.signal_type == Signal.SAMPLE_COMPLETE.value for e in event_observer.events)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___done_event_unregistered___run_finite_acquisition___callback_not_invoked(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -233,9 +230,6 @@ def test___done_event_unregistered___run_finite_acquisition___callback_not_invok
assert len(event_observer.events) == 0


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___every_n_samples_event_unregistered___run_finite_acquisition___callback_not_invoked(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -256,9 +250,6 @@ def test___every_n_samples_event_unregistered___run_finite_acquisition___callbac
assert len(event_observer.events) == 0


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___signal_event_unregistered___run_finite_acquisition___callback_not_invoked(
ai_task_with_real_device: nidaqmx.Task,
) -> None:
Expand Down Expand Up @@ -326,9 +317,6 @@ def test___done_and_every_n_samples_events_registered___run_multiple_finite_acqu
)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___ai_task____run_multiple_finite_acquisitions_with_varying_every_n_samples_event_interval___callbacks_invoked(
ai_task: nidaqmx.Task,
) -> None:
Expand Down Expand Up @@ -361,9 +349,6 @@ def test___ai_task____run_multiple_finite_acquisitions_with_varying_every_n_samp
] == every_n_samples_event_counts


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=AssertionError
)
def test___done_event_registered___register_done_event___already_registered_error_raised(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -379,9 +364,6 @@ def test___done_event_registered___register_done_event___already_registered_erro
assert exc_info.value.error_code == DAQmxErrors.DONE_EVENT_ALREADY_REGISTERED


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=AssertionError
)
def test___every_n_samples_acquired_into_buffer_event_registered___register_every_n_samples_acquired_into_buffer_event___already_registered_error_raised(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -404,9 +386,6 @@ def test___every_n_samples_acquired_into_buffer_event_registered___register_ever
)


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=AssertionError
)
def test___every_n_samples_transferred_from_buffer_event_registered___register_every_n_samples_transferred_from_buffer_event___already_registered_error_raised(
ao_task: nidaqmx.Task,
) -> None:
Expand All @@ -429,7 +408,6 @@ def test___every_n_samples_transferred_from_buffer_event_registered___register_e
)


@pytest.mark.grpc_xfail(reason="Requires NI gRPC Device Server version 2.2 or later")
def test___signal_event_registered___register_signal_event___already_registered_error_raised(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -445,7 +423,6 @@ def test___signal_event_registered___register_signal_event___already_registered_
assert exc_info.value.error_code == DAQmxErrors.SIGNAL_EVENT_ALREADY_REGISTERED


@pytest.mark.grpc_xfail(reason="Requires NI gRPC Device Server version 2.2 or later")
def test___ai_task___register_wrong_every_n_samples_event___not_supported_by_device_error_raised(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -465,7 +442,6 @@ def test___ai_task___register_wrong_every_n_samples_event___not_supported_by_dev
)


@pytest.mark.grpc_xfail(reason="Requires NI gRPC Device Server version 2.2 or later")
def test___ao_task___register_wrong_every_n_samples_event___not_supported_by_device_error_raised(
ao_task: nidaqmx.Task,
) -> None:
Expand All @@ -485,7 +461,6 @@ def test___ao_task___register_wrong_every_n_samples_event___not_supported_by_dev
)


@pytest.mark.grpc_xfail(reason="Requires NI gRPC Device Server version 2.2 or later")
def test___task___register_unregister_done_event___callback_not_invoked(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -498,9 +473,6 @@ def test___task___register_unregister_done_event___callback_not_invoked(
assert len(event_observer.events) == 0


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___task___register_unregister_every_n_samples_acquired_into_buffer_event___callback_not_invoked(
ai_task: nidaqmx.Task,
) -> None:
Expand All @@ -515,9 +487,6 @@ def test___task___register_unregister_every_n_samples_acquired_into_buffer_event
assert len(event_observer.events) == 0


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___task___register_unregister_every_n_samples_transferred_from_buffer_event___callback_not_invoked(
ao_task: nidaqmx.Task,
) -> None:
Expand All @@ -532,9 +501,6 @@ def test___task___register_unregister_every_n_samples_transferred_from_buffer_ev
assert len(event_observer.events) == 0


@pytest.mark.grpc_xfail(
reason="Requires NI gRPC Device Server version 2.2 or later", raises=RpcError
)
def test___task___register_unregister_signal_event___callback_not_invoked(
ai_task: nidaqmx.Task,
) -> None:
Expand Down
Loading

0 comments on commit 19a9d47

Please sign in to comment.