mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.9] bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported (GH-22595) (GH-22609)
(cherry picked from commit 4a9f82f50d
)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
3da210b69f
commit
c6f41e62f5
2 changed files with 4 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
import unittest
|
import unittest
|
||||||
from test.support import check_warnings
|
from test.support import check_warnings, import_fresh_module
|
||||||
|
|
||||||
with check_warnings(("", PendingDeprecationWarning)):
|
with check_warnings(("", PendingDeprecationWarning)):
|
||||||
from lib2to3.tests import load_tests
|
load_tests = import_fresh_module('lib2to3.tests', fresh=['lib2to3']).load_tests
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
|
@ -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.
|
Loading…
Add table
Add a link
Reference in a new issue