nipy / nibabel

Python package to access a cacophony of neuro-imaging file formats
http://nipy.org/nibabel/
Other
634 stars 258 forks source link

TEST: Accommodate pytest 8 changes #1297

Closed effigies closed 4 months ago

effigies commented 4 months ago

In earlier pytest, the following would "xfail":

@pytest.mark.xfail(raises=SomeException)
def example:
    with pytest.warns(SomeWarning):
        raise SomeException

Now, the failure to raise SomeWarning prior to raising an exception causes the test to fail in an unexpected way, presumably due to the order of exception chaining.

This PR adjusts our expected warning check to be disabled if an exception is expected to come first.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.25%. Comparing base (5d884bd) to head (cff2936).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1297 +/- ## ========================================== + Coverage 92.23% 92.25% +0.01% ========================================== Files 99 99 Lines 12461 12467 +6 Branches 2562 2563 +1 ========================================== + Hits 11494 11502 +8 + Misses 643 642 -1 + Partials 324 323 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.