Skip to content

Conversation

bwhitt7
Copy link
Contributor

@bwhitt7 bwhitt7 commented Aug 29, 2025

This PR is related to #29552. This PR has the goal of making NumPy's testing suite more thread safe. This introduces changes to the setup methods for 5 more testing files, 4 in numpy/ma and one in numpy/matrixlib. Pytest's classic xunit setup and teardown methods are thread unsafe, typically not running before the tests do, leading to AttributionErrors. This PR changes these setup method to basic "creation" methods that are called within the tests that need them.

For test_old_ma and test_subclassing, while all of the thread-unsafe setup methods have been replaced, there are still some thread safety issues with a few tests (either due to usage of global state or stdout), so you can't run them all with parallel threads just yet.

Copy link
Member

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

Thank you!

@ngoldbaum ngoldbaum merged commit 17632fa into numpy:main Sep 1, 2025
77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants