summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-10-06 22:40:22 (GMT)
committerGitHub <noreply@github.com>2022-10-06 22:40:22 (GMT)
commite1c4d56fdde28728c37de855edbb463fa0d7f95d (patch)
treeb4c3a715e975f6349a8b07d856965fffb911f26d /Lib/test/test_inspect.py
parentf8edc6ff531bb98858185857513371f14519ed1d (diff)
downloadcpython-e1c4d56fdde28728c37de855edbb463fa0d7f95d.zip
cpython-e1c4d56fdde28728c37de855edbb463fa0d7f95d.tar.gz
cpython-e1c4d56fdde28728c37de855edbb463fa0d7f95d.tar.bz2
gh-65961: Do not rely solely on `__cached__` (GH-97990)
Make sure `__spec__.cached` (at minimum) can be used.
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index be9f29e..710b609 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -4358,8 +4358,11 @@ class TestMain(unittest.TestCase):
'unittest', '--details')
output = out.decode()
# Just a quick sanity check on the output
+ self.assertIn(module.__spec__.name, output)
self.assertIn(module.__name__, output)
+ self.assertIn(module.__spec__.origin, output)
self.assertIn(module.__file__, output)
+ self.assertIn(module.__spec__.cached, output)
self.assertIn(module.__cached__, output)
self.assertEqual(err, b'')