ni / nidaqmx-python

A Python API for interacting with NI-DAQmx
Other
443 stars 157 forks source link

Add Analog Stream Reader tests #493

Closed zhindes closed 8 months ago

zhindes commented 8 months ago

What does this Pull Request accomplish?

This ensures we have a test per method for each of the Analog and Power stream readers classes. The existing and new tests all have channel-specific data validation by taking advantage of the behavior of simulated DAQ scaling. This ensures we don't inadvertently swap channels within the Python or underlying C bindings.

Why should this Pull Request be merged?

This will give us confidence that we haven't broken anything as we refactor parts of the Python and driver stack.

What testing has been done?

$ poetry run ni-python-styleguide fix tests && poetry run ni-python-styleguide lint tests && poetry run pytest -rs -k test_stream_readers
=============================== test session starts ===============================
platform win32 -- Python 3.10.10, pytest-7.4.2, pluggy-1.3.0
rootdir: C:\dev\nidaqmx-python
configfile: pyproject.toml
testpaths: tests
plugins: cov-4.1.0, mock-3.11.1
collected 1569 items / 1521 deselected / 48 selected

tests\component\test_stream_readers.py ..................................... [ 77%]
...........                                                                  [100%]

======================= 48 passed, 1521 deselected in 2.54s =======================
github-actions[bot] commented 8 months ago

Test Results

    30 files  ±  0      30 suites  ±0   34m 42s :stopwatch: -23s  1 586 tests + 56   1 406 :white_check_mark: + 56    180 :zzz: ±0  0 :x: ±0  24 420 runs  +840  21 800 :white_check_mark: +840  2 620 :zzz: ±0  0 :x: ±0 

Results for commit 68cbc662. ± Comparison against base commit 457077b6.

:recycle: This comment has been updated with latest results.