Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address review: make the test slightly more accurate
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
erlend-aasland and AlexWaygood authored Jul 3, 2023
commit 5ac85539ca1cd86a86cbecb3cec256970c8a5c84
8 changes: 5 additions & 3 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,16 +814,18 @@ def test_other_bizarre_things_in_annotations_fail(self):
self.assertEqual(s, expected_failure_message)

def test_bizarre_parseable_annotations(self):
Comment thread
erlend-aasland marked this conversation as resolved.
Outdated
msg = "Cannot use a kwarg splat in a function-call annotation"
expected_error_msg = (
"Error on line 0\n"
"Cannot use a kwarg splat in a function-call annotation"
)
dataset = (
'module fo\nfo.barbaz\n o: bool(**{None: "bang!"})',
'module fo\nfo.barbaz -> bool(**{None: "bang!"})',
)
Comment thread
erlend-aasland marked this conversation as resolved.
for fn in dataset:
with self.subTest(fn=fn):
out = self.parse_function_should_fail(fn)
self.assertTrue(out.startswith("Error on line 0"))
self.assertIn(msg, out)
self.assertEqual(out, expected_error_msg)

def test_unused_param(self):
block = self.parse("""
Expand Down