Skip to content

Commit a8af464

Browse files
yihong0618picnixz
andauthored
Update Lib/test/test_inspect/test_inspect.py
Co-authored-by: Bénédikt Tran <[email protected]>
1 parent ccd79d6 commit a8af464

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -812,13 +812,10 @@ def test_getfile_builtin_module(self):
812812
self.assertStartsWith(str(e.exception), '<module')
813813

814814
def test_getfile_custom_module(self):
815-
import re
816-
custom_module = types.ModuleType('custom_module')
817-
msg = re.escape(
818-
f'Cannot get source from {custom_module!r}'
819-
)
815+
my_mod = types.ModuleType('my_mod')
816+
msg = re.escape(f'cannot get source from {my_mod!r}')
820817
with self.assertRaisesRegex(TypeError, msg) as e:
821-
inspect.getfile(custom_module)
818+
inspect.getfile(my_mod)
822819

823820
def test_getfile_builtin_class(self):
824821
with self.assertRaises(TypeError) as e:

0 commit comments

Comments
 (0)