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-34185: Fix test module collision in test_bdb when ran as script #8537
Conversation
When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. Indeed, when running `./python Lib/test/test_bdb.py` ("as a script"), `sys.path[0]` is getting filled with the path to Lib/test. The chosen solution here was to change the name of the temporary module created by test_bdb.py .
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. When your account is ready, please add a comment in this pull request You can check yourself Thanks again for your contribution, we look forward to reviewing it! |
Thanks @lajarre for the PR, and @serhiy-storchaka for merging it |
…ythonGH-8537) When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. (cherry picked from commit 54fd455) Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
GH-10935 is a backport of this pull request to the 3.7 branch. |
…ythonGH-8537) When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. (cherry picked from commit 54fd455) Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
GH-10936 is a backport of this pull request to the 3.6 branch. |
…ythonGH-8537) When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. (cherry picked from commit 54fd455) Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
GH-10937 is a backport of this pull request to the 2.7 branch. |
Thank you for your contribution @lajarre! |
…H-8537) When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. (cherry picked from commit 54fd455) Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
…H-8537) When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. (cherry picked from commit 54fd455) Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
…H-8537) (GH-10936) When running test_bdb.py as a script, `import test_module` would be importing the existing Lib/test/test_modules.py instead of the tempcwd/test_module.py module which was dynamically created by test_bdb.py itself. (cherry picked from commit 54fd455) Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
When running test_bdb.py as a script,
import test_module
would beimporting the existing Lib/test/test_modules.py instead of the
tempcwd/test_module.py module which was dynamically created by
test_bdb.py itself.
Indeed, when running
./python Lib/test/test_bdb.py
("as a script"),sys.path[0]
is getting filled with the path to Lib/test.The chosen solution here was to change the name of the temporary module
created by test_bdb.py .
https://bugs.python.org/issue34185