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
bpo-25094: Fix test_tools.test_sundry() on Windows #8406
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test.
I tested manually my fix on an installed Python 3.6 by replacing C:\Python36\Lib\test\test_tools\test_sundry.py: the fix works as expected. |
Thanks @vstinner for the PR |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 23, 2018
When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test. (cherry picked from commit 752d4b7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
GH-8407 is a backport of this pull request to the 3.7 branch. |
GH-8408 is a backport of this pull request to the 3.6 branch. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 23, 2018
When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test. (cherry picked from commit 752d4b7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
miss-islington
added a commit
that referenced
this pull request
Jul 23, 2018
When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test. (cherry picked from commit 752d4b7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
vstinner
added a commit
that referenced
this pull request
Jul 23, 2018
When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test. (cherry picked from commit 752d4b7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
yahya-abou-imran
pushed a commit
to yahya-abou-imran/cpython
that referenced
this pull request
Nov 2, 2018
When Python is installed on Windows, python -m test test_tools failed because it tried to run Tools\scripts\2to3.py which requires an argument. Skip this script. On other platforms or on Windows but when run from source code (not installed), the script is called "2to3" instead of "2to.py" and so was already skipped. Modify also the unit test to unload all modules which have been loaded by the test.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
When Python is installed on Windows, python -m test test_tools
failed. Fix test_sundry() test by fixing sys.argv before loading
scripts. Run 2to3 with one argument: test_tools/test_sundry.py.
Modify also the unit test to unload all modules which have been
loaded by the test. Moreover, use CleanImport() context manager to
make sure that 'name' module is not already loaded.
https://bugs.python.org/issue25094