diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-12-13 10:14:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-13 10:14:51 (GMT) |
commit | e55deaabd8de338138cf29aea6890996e794c997 (patch) | |
tree | 5f5f6ca684fa7b3e147df4f7a2daf57786627a84 /Lib/test | |
parent | 7da90251ae80f5faac938b659675ff159d565537 (diff) | |
download | cpython-e55deaabd8de338138cf29aea6890996e794c997.zip cpython-e55deaabd8de338138cf29aea6890996e794c997.tar.gz cpython-e55deaabd8de338138cf29aea6890996e794c997.tar.bz2 |
[3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080)
Functions signal(), getsignal(), pthread_sigmask(), sigpending(),
sigwait() and valid_signals() were omitted.
If __all__ is not defined all non-builtin functions should have
correct __module__.
(cherry picked from commit e08c0d8eec528f1d7a282ee19bcadb9aae9ec123)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_signal.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py index 2144d61..c2b5861 100644 --- a/Lib/test/test_signal.py +++ b/Lib/test/test_signal.py @@ -1,4 +1,5 @@ import errno +import inspect import os import random import signal @@ -33,6 +34,14 @@ class GenericTests(unittest.TestCase): self.assertIsInstance(sig, signal.Signals) self.assertEqual(sys.platform, "win32") + def test_functions_module_attr(self): + # Issue #27718: If __all__ is not defined all non-builtin functions + # should have correct __module__ to be displayed by pydoc. + for name in dir(signal): + value = getattr(signal, name) + if inspect.isroutine(value) and not inspect.isbuiltin(value): + self.assertEqual(value.__module__, 'signal') + @unittest.skipIf(sys.platform == "win32", "Not valid on Windows") class PosixTests(unittest.TestCase): |