diff options
author | Alex Waygood <Alex.Waygood@Gmail.com> | 2023-07-28 18:10:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-28 18:10:45 (GMT) |
commit | ecc05e23a1f4086645cfb5362c4c1351f70a4eb1 (patch) | |
tree | efadb6c91e4aef09fbaefb4c6b0942c66b7f6169 /Lib | |
parent | 3a1d819ebc36189e086198212822c9b29384f242 (diff) | |
download | cpython-ecc05e23a1f4086645cfb5362c4c1351f70a4eb1.zip cpython-ecc05e23a1f4086645cfb5362c4c1351f70a4eb1.tar.gz cpython-ecc05e23a1f4086645cfb5362c4c1351f70a4eb1.tar.bz2 |
gh-106368: Argument clinic: Fix minor bug in `state_modulename_name` (#107387)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_clinic.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 2f74ee2..3ce27d1 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -84,6 +84,7 @@ class FakeClinic: ('parser_definition', d('block')), ('impl_definition', d('block')), )) + self.functions = [] def get_destination(self, name): d = self.destinations.get(name) @@ -104,6 +105,9 @@ class FakeClinic: _module_and_class = clinic.Clinic._module_and_class + def __repr__(self): + return "<FakeClinic object>" + class ClinicWholeFileTest(_ParserBase): def setUp(self): @@ -672,6 +676,19 @@ class ClinicParserTest(_ParserBase): """) self.assertEqual("os_stat_fn", function.c_basename) + def test_cloning_nonexistent_function_correctly_fails(self): + stdout = self.parse_function_should_fail(""" + cloned = fooooooooooooooooooooooo + This is trying to clone a nonexistent function!! + """) + expected_error = """\ +cls=None, module=<FakeClinic object>, existing='fooooooooooooooooooooooo' +(cls or module).functions=[] +Error on line 0: +Couldn't find existing function 'fooooooooooooooooooooooo'! +""" + self.assertEqual(expected_error, stdout) + def test_return_converter(self): function = self.parse_function(""" module os |