Skip to content

Commit

Permalink
assert "from" not in repr of module with strange loader
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Snow <[email protected]>
  • Loading branch information
AlexWaygood and ericsnowcurrently authored Nov 27, 2023
1 parent e5ca4de commit 4293ced
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Lib/test/test_module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def test_module_repr_with_namespace_package_and_custom_loader(self):
m.__spec__ = spec
expected_repr_pattern = r"<module 'foo' \(<.*\.BareLoader object at .+>\)>"
self.assertRegex(repr(m), expected_repr_pattern)
self.assertNotIn('from', repr(m))

def test_module_finalization_at_shutdown(self):
# Module globals and builtins should still be available during shutdown
Expand Down

0 comments on commit 4293ced

Please sign in to comment.