Skip to content

Commit 917afb1

Browse files
committed
Removing tests based on 5142 and 5124
1 parent be57857 commit 917afb1

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/nimodinst/system_tests/test_system_nimodinst.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
11
#!/usr/bin/python
22

33
import nimodinst
4+
import pytest
45
import re
56

67

8+
# Many of the tests below require at least one instrument (real or simulated) to be present in the
9+
# system. nimodinst cannot create its own simulated devices; it enumerates instruments configured
10+
# for other drivers. Because these simulated instruments cannot be created via nisimdev in this
11+
# environment, the tests are skipped here and are expected to run through the pipeline where
12+
# instruments are preconfigured.
13+
_requires_instrument_skip_reason = (
14+
'Requires an instrument (real or simulated) present in the system, which cannot be created via '
15+
'nisimdev in this environment. Run through pipeline where instruments are preconfigured.'
16+
)
17+
18+
719
def test_bad_device_family():
820
with nimodinst.Session('FAKE') as session:
921
assert len(session) == 0
1022

1123

24+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
1225
def test_no_device_family():
1326
with nimodinst.Session('') as session:
1427
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
1528

1629

30+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
1731
def test_device_family_string_with_dashes():
1832
with nimodinst.Session('NI-SCOPE') as session:
1933
assert len(session) > 0, 'This test expects a device supported by NI-SCOPE in the system (real or simulated).'
2034

2135

36+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
2237
def test_device_family_string_without_dashes():
2338
with nimodinst.Session('niscope') as session:
2439
assert len(session) > 0, 'This test expects a device supported by NI-SCOPE in the system (real or simulated).'
@@ -44,13 +59,15 @@ def test_string_attribute_error_on_non_existant_device():
4459
pass
4560

4661

62+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
4763
def test_device_name_attribute():
4864
with nimodinst.Session('') as session:
4965
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
5066
assert isinstance(session.devices[0].device_name, str)
5167
assert len(session.devices[0].device_name) > 0 # device name must be at least 1 character
5268

5369

70+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
5471
def test_device_model_attribute():
5572
with nimodinst.Session('') as session:
5673
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
@@ -60,6 +77,7 @@ def test_device_model_attribute():
6077
assert re.search(pattern, session.devices[0].device_model) is not None # NI Model numbers are generally "NI PXIe-2532", but might also be "USB-2532"
6178

6279

80+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
6381
def test_serial_number_attribute():
6482
with nimodinst.Session('') as session:
6583
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
@@ -68,36 +86,42 @@ def test_serial_number_attribute():
6886
assert (len(session.devices[0].serial_number) == 0) or (re.search(pattern, session.devices[0].serial_number) is not None) # NI Serial numbers hex unless it is simulated than it is 0
6987

7088

89+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
7190
def test_bus_number_attribute():
7291
with nimodinst.Session('') as session:
7392
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
7493
assert isinstance(session.devices[0].bus_number, int)
7594

7695

96+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
7797
def test_chassis_number_attribute():
7898
with nimodinst.Session('') as session:
7999
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
80100
assert isinstance(session.devices[0].chassis_number, int)
81101

82102

103+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
83104
def test_max_pciexpress_link_width_attribute():
84105
with nimodinst.Session('') as session:
85106
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
86107
assert isinstance(session.devices[0].max_pciexpress_link_width, int)
87108

88109

110+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
89111
def test_pciexpress_link_width_attribute():
90112
with nimodinst.Session('') as session:
91113
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
92114
assert isinstance(session.devices[0].pciexpress_link_width, int)
93115

94116

117+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
95118
def test_slot_number_attribute():
96119
with nimodinst.Session('') as session:
97120
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'
98121
assert isinstance(session.devices[0].slot_number, int)
99122

100123

124+
@pytest.mark.skip(reason=_requires_instrument_skip_reason)
101125
def test_socket_number_attribute():
102126
with nimodinst.Session('') as session:
103127
assert len(session) > 0, 'This test expects an instrument in the system (real or simulated).'

src/niscope/system_tests/test_system_niscope.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ def test_configure_chan_characteristics(self, multi_instrument_session):
441441
multi_instrument_session.configure_chan_characteristics(50, 0)
442442
assert 50.0 == multi_instrument_session.input_impedance
443443

444+
@pytest.mark.skip(reason="Requires a persistently simulated PXI-5142 instrument named '5142' which cannot be created via nisimdev. Run through pipeline where it is preconfigured.")
444445
def test_filter_coefficients(self, session_5142):
445446
assert [1.0] + [0.0] * 34 == session_5142.get_equalization_filter_coefficients() # coefficients list should have 35 items
446447
try:
@@ -513,6 +514,7 @@ def test_import_export_file(self, multi_instrument_session):
513514
def test_configure_trigger_software(self, multi_instrument_session):
514515
multi_instrument_session.configure_trigger_software()
515516

517+
@pytest.mark.skip(reason="Requires a persistently simulated PXI-5124 instrument named '5124' which cannot be created via nisimdev. Run through pipeline where it is preconfigured.")
516518
def test_configure_trigger_video(self, session_5124):
517519
session_5124.configure_trigger_video('0', niscope.VideoSignalFormat.PAL, niscope.VideoTriggerEvent.FIELD1, niscope.VideoPolarity.POSITIVE, niscope.TriggerCoupling.DC)
518520
assert niscope.VideoSignalFormat.PAL == session_5124.tv_trigger_signal_format

0 commit comments

Comments
 (0)