ni / nidaqmx-python

A Python API for interacting with NI-DAQmx
Other
413 stars 155 forks source link

tests: Fix tests that relied on NumPy 1.x integer promotion #601

Closed bkeryan closed 1 month ago

bkeryan commented 1 month ago

What does this Pull Request accomplish?

Change AnalogUnscaledReader unsigned data type tests to explicitly promote to a larger signed type before comparing to pytest.approx. NumPy 1.x did this promotion automatically, but NumPy 2.x preserves the unsigned data type, leading to integer overflows.

Why should this Pull Request be merged?

Fixes #600

What testing has been done?

Ran updated tests with Python 3.9 64-bit on Windows, with both NumPy 1.26 and NumPy 2.0.

github-actions[bot] commented 1 month ago

Test Results

    34 files  ±0      34 suites  ±0   46m 50s :stopwatch: -23s  2 298 tests ±0   1 934 :white_check_mark: ±0    364 :zzz: ±0  0 :x: ±0  40 722 runs  ±0  34 542 :white_check_mark: ±0  6 180 :zzz: ±0  0 :x: ±0 

Results for commit 3e18650c. ± Comparison against base commit 4917248b.