8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e30a16d commit 07d894dCopy full SHA for 07d894d
tests/compat/py312.py
@@ -0,0 +1,18 @@
1
+import contextlib
2
+
3
+from .py39 import import_helper
4
5
6
+@contextlib.contextmanager
7
+def isolated_modules():
8
+ """
9
+ Save modules on entry and cleanup on exit.
10
11
+ (saved,) = import_helper.modules_setup()
12
+ try:
13
+ yield
14
+ finally:
15
+ import_helper.modules_cleanup(saved)
16
17
18
+vars(import_helper).setdefault('isolated_modules', isolated_modules)
tests/compat/py39.py
@@ -4,3 +4,4 @@
os_helper = try_import('os_helper') or from_test_support(
'FS_NONASCII', 'skip_unless_symlink'
)
+import_helper = try_import('import_helper') or from_test_support()
0 commit comments