8000 bpo-41970: Avoid test failure in test_lib2to3 if the module is alread… · python/cpython@e1d7efd · GitHub
[go: up one dir, main page]

Skip to content

Commit e1d7efd

Browse files
committed
bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported
1 parent 044a104 commit e1d7efd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/test/test_lib2to3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import unittest
2+
from test.support.import_helper import import_fresh_module
23
from test.support.warnings_helper import check_warnings
34

45
with check_warnings(("", PendingDeprecationWarning)):
5-
from lib2to3.tests import load_tests
6+
load_tests = import_fresh_module('lib2to3.tests', fresh=['lib2to3']).load_tests
67

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

0 commit comments

Comments
 (0)
0