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 6ca5cdb commit 94363aeCopy full SHA for 94363ae
1 file changed
Lib/test/test_lazy_import/__init__.py
@@ -1948,6 +1948,13 @@ def test_normal_import_dis(self):
1948
else:
1949
self.assertFail("IMPORT_NAME not found")
1950
1951
+ def test_eager_import_dis(self):
1952
+ """non module level import should show eager"""
1953
+ code = compile("def f(): import foo", "exec", "exec")
1954
+ f = io.StringIO()
1955
+ dis.dis(code, file=f)
1956
+ self.assertIn("foo + eager", f.getvalue())
1957
+
1958
1959
@unittest.skipIf(_testcapi is None, 'need the _testcapi module')
1960
class LazyCApiTests(unittest.TestCase):
0 commit comments