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

…

Automerge-Triggered-By: @pablogsal
This commit is contained in:
Pablo Galindo 2020-10-08 14:24:28 +01:00 committed by GitHub
parent 35f041dd01
commit 4a9f82f50d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -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()

View File

@ -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.