mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-107805: Fix signatures of module-level generated functions in turtle
(#107807)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
3edcf743e8
commit
044b8b3b6a
3 changed files with 45 additions and 19 deletions
|
@ -461,5 +461,25 @@ class TestTPen(unittest.TestCase):
|
|||
self.assertTrue(tpen.isdown())
|
||||
|
||||
|
||||
class TestModuleLevel(unittest.TestCase):
|
||||
def test_all_signatures(self):
|
||||
import inspect
|
||||
|
||||
known_signatures = {
|
||||
'teleport':
|
||||
'(x=None, y=None, *, fill_gap: bool = False) -> None',
|
||||
'undo': '()',
|
||||
'goto': '(x, y=None)',
|
||||
'bgcolor': '(*args)',
|
||||
'pen': '(pen=None, **pendict)',
|
||||
}
|
||||
|
||||
for name in known_signatures:
|
||||
with self.subTest(name=name):
|
||||
obj = getattr(turtle, name)
|
||||
sig = inspect.signature(obj)
|
||||
self.assertEqual(str(sig), known_signatures[name])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue