diff options
author | Victor Stinner <vstinner@python.org> | 2023-08-31 21:14:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 21:14:23 (GMT) |
commit | c6d56135e151a19c79d002cb1f1dbcd1c766c51d (patch) | |
tree | ef2576000fef9a67ccd973ea7731758ce01560c6 /Lib/test/test_pydoc.py | |
parent | d48760b2f1e28dd3c1a35721939f400a8ab619b8 (diff) | |
download | cpython-c6d56135e151a19c79d002cb1f1dbcd1c766c51d.zip cpython-c6d56135e151a19c79d002cb1f1dbcd1c766c51d.tar.gz cpython-c6d56135e151a19c79d002cb1f1dbcd1c766c51d.tar.bz2 |
gh-108638: Fix tests when _stat extension is missing (#108689)
Fix test_inspect and test_pydoc when the _stat extension is missing.
Skip tests relying on _stat when _stat is missing.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 9b5c11bf..499eeb9 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -1187,7 +1187,13 @@ class TestDescriptions(unittest.TestCase): "time()") def test_module_level_callable_o(self): - self.assertEqual(self._get_summary_line(stat.S_IMODE), + try: + import _stat + except ImportError: + # stat.S_IMODE() and _stat.S_IMODE() have a different signature + self.skipTest('_stat extension is missing') + + self.assertEqual(self._get_summary_line(_stat.S_IMODE), "S_IMODE(object, /)") def test_unbound_builtin_method_noargs(self): |