summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_lib2to3.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-10-08 13:24:28 (GMT)
committerGitHub <noreply@github.com>2020-10-08 13:24:28 (GMT)
commit4a9f82f50d957b6cf3fd207de8b583d9137316b8 (patch)
treeacc610941025f7ce5026f863413c7e44832602a2 /Lib/test/test_lib2to3.py
parent35f041dd0171f575fc3adce1709b31fdf45a5ff6 (diff)
downloadcpython-4a9f82f50d957b6cf3fd207de8b583d9137316b8.zip
cpython-4a9f82f50d957b6cf3fd207de8b583d9137316b8.tar.gz
cpython-4a9f82f50d957b6cf3fd207de8b583d9137316b8.tar.bz2
bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported (GH-22595)
… Automerge-Triggered-By: @pablogsal
Diffstat (limited to 'Lib/test/test_lib2to3.py')
-rw-r--r--Lib/test/test_lib2to3.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py
index 159a838..fd12a7e 100644
--- a/Lib/test/test_lib2to3.py
+++ b/Lib/test/test_lib2to3.py
@@ -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()