Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Lib/test/test_lazy_import/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1948,6 +1948,13 @@ def test_normal_import_dis(self):
else:
self.assertFail("IMPORT_NAME not found")

def test_eager_import_dis(self):
"""non module level import should show eager"""
code = compile("def f(): import foo", "exec", "exec")
f = io.StringIO()
dis.dis(code, file=f)
self.assertIn("foo + eager", f.getvalue())


@unittest.skipIf(_testcapi is None, 'need the _testcapi module')
class LazyCApiTests(unittest.TestCase):
Expand Down
Loading