Skip to content

Fix test fails caused by pytest 7.1.3#17296

Merged
andyfaff merged 4 commits intoscipy:mainfrom
andyfaff:pytest
Oct 26, 2022
Merged

Fix test fails caused by pytest 7.1.3#17296
andyfaff merged 4 commits intoscipy:mainfrom
andyfaff:pytest

Conversation

@andyfaff
Copy link
Copy Markdown
Contributor

The new pytest release broke some of our test suite. This PR fixes the test suite and will return the CI suite to green-ish.

@tylerjereddy tylerjereddy added the maintenance Items related to regular maintenance tasks label Oct 26, 2022
Copy link
Copy Markdown
Contributor

@tylerjereddy tylerjereddy left a comment

Choose a reason for hiding this comment

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

I compared this branch with main locally (with latest pytest/pytest-xdist) and did indeed see some nice improvement:

  • main: 4 failed, 37614 passed, 2237 skipped, 140 xfailed, 8 xpassed, 134 errors in 266.74s (0:04:26)
  • here: 37752 passed, 2237 skipped, 140 xfailed, 8 xpassed in 261.01s (0:04:21)

I didn't check the changes too closely, but on main there were tons of errors related to nose support--is that related to your setup -> setup_method style changes?

I'm not sure there's much we can do about that linter complaint:
E711 comparison to None should be 'if cond is None:'

Unless I'm really forgetting something major, I think three are various technical reasons that is "ufuncs" don't exist.

@tylerjereddy tylerjereddy added this to the 1.10.0 milestone Oct 26, 2022
@andyfaff
Copy link
Copy Markdown
Contributor Author

I think the four minpack tests are more smoke tests to check that concurrency can work. There's probably no need to check the return value, but I can rearrange those four tests to eliminate the lint fail.

Setup and teardown had to be changed to setup_method and teardown_method with this version of pytest. This was the majority of the test fails.

@WarrenWeckesser
Copy link
Copy Markdown
Member

WarrenWeckesser commented Oct 26, 2022

I'm not sure there's much we can do about that linter complaint:

The check with the "nonpythonic" use of == None,

assert np.all(np.array(v) == None)

could be written

np.testing.assert_array_equal(y, None)

or, without NumPy,

assert all([result is None for result in v])

Note that the latter is much faster than the use of assert_array_equal.

@andyfaff
Copy link
Copy Markdown
Contributor Author

@WarrenWeckesser I was going to use the second version in another commit.

@andyfaff
Copy link
Copy Markdown
Contributor Author

Done

@andyfaff
Copy link
Copy Markdown
Contributor Author

Ok. Got most of the test breakages fixed now, so am merging. THere's one remaining that is pytest-xdist related.

@andyfaff andyfaff merged commit e58292e into scipy:main Oct 26, 2022
@andyfaff andyfaff deleted the pytest branch October 26, 2022 05:39
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Dec 8, 2022
https://build.opensuse.org/request/show/1040954
by user dgarcia + dimstar_suse
- Add fix-tests-pytest72.patch to fix the tests that fails with pytest 7
  gh#scipy/scipy#17296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Items related to regular maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants