CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix test failures from repeated test runs #15163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This fixes an issue where the dotprint doctest would fail after the tests were run in the same session. See sympy#15149.
âś… Hi, I am the SymPy bot (v130). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.2.1. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
…octests This prevents doctests that call init_printing() without no_global=True from affecting other doctests. This fixes a mathematica_code doctest failure that occurred from running the rst doctests twice in the same session (sympy#15163).
Thanks! Regarding travis testing: couldn't you set the |
There's no functional difference between setting it outside of Python and setting it in Python. The only difference is if we set it outside of Python, we have to do it in a shell language. Also doing it that way would make it not enabled by default (e.g., when users run the tests on their own machines). Actually, so far these have been revealing real bugs, which could also occur when using these functions multiple times in the same session. For instance, the |
I just mean setting it outside of python on the travis build to test the behaviour. |
Well the only difference is that the tests don't run in a subprocess, which can also be done with |
Yes but running it without subprocesses on travis may help catch those bugs. |
We would have to run the tests twice. Just running them once and nothing else with subprocess=False is no different from running them with subprocess=True. Unfortunately, we already have too many Travis builds (the full test suite is split into 5 builds for each Python version), so we don't have the resources to run tests like this. We'll just have to occasionally do it manually. |
Without this, there are doctest failures from the Singleton doctests when its run twice in the same Python session (doctest('singleton', subprocess=False)). There are still some side effects from running the tests or doctests with subprocess=False, in that the test singleton classes are registered on the S object. Fixes a failure from sympy#15149.
Alright I thought running it without subprocesses would always expose more bugs. But now thinking about it I realized that it may also hide bugs where the tests rely on some global state so I guess you can't have your cake and eat it too. |
Otherwise it changes the behavior of Q.prime after the test has been run. Related to issue sympy#15149
This messes up any further autowrap calls, as it gets confused with prior modules. This fixes test failures from running the autowrap tests twice in the same Python session (subprocess=False). See issue sympy#15149.
Based on the discussion at sympy#15149, there isn't a good way to make the IPython tests not modify the existing IPython session, or to not affect itself when run twice in the same Python session (test('ipython', subprocess=False)), because IPython uses a single shell instance which gets modified by the test.
If you run the test or doctests multiple times in the same process, you get some failures. See #15149.
To reproduce the errors, run
Unfortunately, we can't really test this on CI, as it would require running all the tests twice. Plus we split the tests up and some failures are cross-failures (e.g., doctest failures that come from running the tests).
I intend to push as many fixes here as I can, but feel free to review at any time.
References to other Issues or PRs
Address many issues in #15149, but not all of them yet.
Brief description of what is fixed or changed
Other comments
Release Notes
dotprint
function no longer affect consecutive calls.S
object.