Skip to content

Commit 2eefa74

Browse files
committed
added missing testcases
1 parent 3985150 commit 2eefa74

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/functional/i/import_module_shadowing.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ def test_shadowed_format_call(self):
4848
messages = self._run_pylint(code)
4949
errors = [msg for msg in messages if msg.msg_id == "E0611"]
5050
self.assertEqual(len(errors), 0)
51-
52-
def test_shadowed_other_method(self):
51+
52+
def test_early_module_yield(self):
5353
code = "import my_module.utils as my_module\nmy_module.other_method()\n"
5454
messages = self._run_pylint(code)
5555
errors = [msg for msg in messages if msg.msg_id == "E0611"]
56-
self.assertEqual(len(errors), 0)
56+
self.assertEqual(len(errors), 0, f"Unexpected error: {errors}")
57+
58+
def test_access_module_dict(self):
59+
code = "import my_module.utils as utils\nprint(utils.__dict__)\n"
60+
messages = self._run_pylint(code)
61+
errors = [msg for msg in messages if msg.msg_id == "E0611"]
62+
self.assertEqual(len(errors), 0, f"Should allow __dict__ access: {errors}")
5763

5864
def test_non_shadowed_import(self):
5965
code = "import my_module.utils as utils\nutils.format()\n"

0 commit comments

Comments
 (0)