mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-92265: set meta_path and path_hooks correctly in test_reload_namespace_changed (GH-92275)
Previously, we were blocking the frozen imports and forcing the source version to be used, but we did not fix up sys.meta_path or sys.path_hooks, causing the frozen importers to leak into the source version of the test.
This commit is contained in:
parent
00f22e8cc2
commit
c7d699969c
1 changed files with 2 additions and 1 deletions
|
@ -301,7 +301,8 @@ class ReloadTests:
|
|||
name = 'spam'
|
||||
with os_helper.temp_cwd(None) as cwd:
|
||||
with test_util.uncache('spam'):
|
||||
with import_helper.DirsOnSysPath(cwd):
|
||||
with test_util.import_state(path=[cwd]):
|
||||
self.init._bootstrap_external._install(self.init._bootstrap)
|
||||
# Start as a namespace package.
|
||||
self.init.invalidate_caches()
|
||||
bad_path = os.path.join(cwd, name, '__init.py')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue