Skip to content

bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported #22595

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

Merged
merged 1 commit into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/test/test_lib2to3.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import unittest
from test.support.import_helper import import_fresh_module
from test.support.warnings_helper import check_warnings

with check_warnings(("", PendingDeprecationWarning)):
from lib2to3.tests import load_tests
load_tests = import_fresh_module('lib2to3.tests', fresh=['lib2to3']).load_tests

if __name__ == '__main__':
unittest.main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Avoid a test failure in ``test_lib2to3`` if the module has already imported
at the time the test executes. Patch by Pablo Galindo.