Skip to content

Conversation

@TanYiQing
Copy link
Collaborator

@TanYiQing TanYiQing commented Jun 9, 2025

- [ ] I've updated CHANGELOG.md if applicable.

- [ ] I've added tests applicable for this pull request

What does this Pull Request accomplish?

Tests and fixtures now can select a real X Series device with at least 32 digital I/O lines, using the new real_x_series_device_32dio fixture. The _x_series_device helper accepts a line_number parameter for flexible device selection.

Why should this Pull Request be merged?

This PR aims to fix #629, as well as failures reported in the ATS machine - MIO MiniTS 1. The error occurred because the real X series device used for the test does not support 32 lines. Hence, this PR is needed so that the fixture can filter out and use real X series devices that do support 32 lines.

What testing has been done?

Ran poetry run tox in ATS machine - MIO MiniTS 1, and tests are now passing.

Tests and fixtures now require a real X Series device with at least 32 digital I/O lines, using the new real_x_series_device_32dio fixture. The _x_series_device helper accepts a line_number parameter for flexible device selection. Minor formatting and assertion changes included.
@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2025

Test Results

    34 files  ±0      34 suites  ±0   56m 43s ⏱️ +12s
 2 461 tests ±0   2 091 ✅ ±0    370 💤 ±0  0 ❌ ±0 
43 920 runs  ±0  37 508 ✅ ±0  6 412 💤 ±0  0 ❌ ±0 

Results for commit 730e1e2. ± Comparison against base commit 9515a86.

♻️ This comment has been updated with latest results.

@zhindes
Copy link
Collaborator

zhindes commented Jun 9, 2025

(I know this is a draft :))

@YiQingTan - please fill in the PR description. Also, you have linting errors:

Run poetry run ni-python-styleguide lint
/home/runner/work/nidaqmx-python/nidaqmx-python/.venv/lib/python3.9/site-packages/flake8_import_order/styles.py:3: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import iter_entry_points
./tests/conftest.py:12:1: I201 Missing newline between import groups. 'import nidaqmx.system' is identified as Application and 'import pytest' is identified as Third Party.
./tests/conftest.py:709:1: BLK100 Black would make changes.
./tests/component/test_stream_writers_do.py:659:1: BLK100 Black would make changes.
Error: Process completed with exit code 255.

Introduce new pytest fixtures for DI loopback tasks on ports 0, 1, and 2 for both standard and 32 DIO devices. Update the test function to use the 32 DIO-specific fixtures and assertions. Refactor test code to ensure correct fixture usage for each device type.
@TanYiQing TanYiQing marked this pull request as ready for review June 10, 2025 13:15
Copy link
Collaborator

@bkeryan bkeryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with suggestions

The parameter line_number in _x_series_device and its usages
has been renamed to min_num_lines to better reflect its purpose
as the minimum number of digital lines required. This change
affects both the function definition and its call in the
real_x_series_device_32dio fixture. No logic was altered.
@TanYiQing TanYiQing merged commit daf2900 into master Jun 11, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DO stream writer test failure with PXIe-6361

5 participants