8000 gh-102251: add missing cleanups for `test_import` by sunmy2019 · Pull Request #104796 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-102251: add missing cleanups for test_import #104796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Closed
Prev Previous commit
Next Next commit
rebase after changes to #105085
  • Loading branch information
sunmy2019 committed Jun 1, 2023
commit 695fd16ae82064c57dcc57298d109e3a6612b575
7 changes: 0 additions & 7 deletions Lib/test/test_import/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2327,8 +2327,6 @@ def test_variants(self):
self.assertIs(basic.look_up_self(), basic_lookedup)
self.assertEqual(basic.initialized_count(), expected_init_count)

loaded.module._clear_module_state()

def test_basic_reloaded(self):
# m_copy is copied into the existing module object.
# Global state is not changed.
Expand Down Expand Up @@ -2417,11 +2415,6 @@ def test_with_reinit_reloaded(self):

self.assertIs(reloaded.snapshot.cached, reloaded.module)

if hasattr(loaded.module, '_clear_module_state'):
loaded.module._clear_module_state()
if hasattr(reloaded.module, '_clear_module_state'):
reloaded.module._clear_module_state()

# Currently, for every single-phrase init module loaded
# in multiple interpreters, those interpreters share a
# PyModuleDef for that object, which can be a problem.
Expand Down
0