PennLINC / xcp_d

Post-processing of fMRIPrep, NiBabies, and HCP outputs
https://xcp-d.readthedocs.io
BSD 3-Clause "New" or "Revised" License
74 stars 22 forks source link

Pytest not capturing warnings on release CI jobs since #1040 #1106

Closed tsalo closed 5 months ago

tsalo commented 5 months ago

Summary

Three tests in XCP-D's test suite use with pytest.warns to detect raised warnings. For some reason, these are successfully captured on the standard CI runs (i.e., within the PR, then on main), but are not for the release CI runs.

Additional details

What actually happened?

FAILED xcp_d/tests/test_utils_bids.py::test_collect_participants - Failed: DID NOT WARN. No warnings of type (<class 'xcp_d.utils.bids.BIDSWarning'>,) were emitted.
 Emitted warnings: [].
FAILED xcp_d/tests/test_utils_confounds.py::test_motion_filtering_lp - Failed: DID NOT WARN. No warnings of type (<class 'Warning'>,) were emitted.
 Emitted warnings: [].
FAILED xcp_d/tests/test_utils_confounds.py::test_motion_filtering_notch - Failed: DID NOT WARN. No warnings of type (<class 'UserWarning'>,) were emitted.
 Emitted warnings: [ DeprecationWarning('Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)')].

Reproducing the bug

I'm not actually sure how to reproduce this.

tsalo commented 5 months ago

Ah, I think I understand the problem:

https://github.com/PennLINC/xcp_d/blob/12b567f78f3e3f3d0998e07e1a2b8cf951e01b26/xcp_d/config.py#L120-L136

tsalo commented 5 months ago

1107 solved it!