Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
bpo-40055: distutils tests now disable docutils import #19139
I think @jaraco knows more about
I'm not entirely sure I understand the problem here, but avoiding imports of
I get that it means that importing
regrtest (our test runner) requires that tests have zero side effects. Here the problem are warnings filters.
If a test changes warnings filters: they must be saved and then restored.
Modifying sys.modules is fine.
I'm also fine with only fixing (save/restore?) warnings filters.
I would also prefer to either clear the warnings filters or clear the warnings filters and eject
I don't see the change to the warnings filters as terribly different from modifying
My guess is that the principle behind tests not having side effects is that we want tests or test modules to be independent of one another. If some random test is manipulating filters that other tests may use, that would be a violation of that principle, but this is just
I feel like the right long-term solution would be to move to a testing scenario where every test module is run as separate processes with their own namespaces rather than trying to make sure everything plays nicely with process-wide globals, but that feels like a much bigger undertaking than is warranted for this minor issue, so I say let's go with something where we clear the warnings filters and maybe eject