-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
While anwsering #106133 I've noticed that test_patma does not have tests for some corner-cases:
- Case
case [x] | x: ...is mentined in https://peps.python.org/pep-0634/#capture-patterns but is never tested, the closest we have to it iscase [z] | [1, (0 | 1 as z)] | [z]:, which is not the same - Guards can have side effects according to https://peps.python.org/pep-0634/#guards but it is never tested
- Guards are never tested with: mapping patterns, dotted value patterns
- In
ClassPatternsection PEP says:If name_or_attr is not an instance of the builtin type, TypeError is raised.It is never tested inTestTypeErrors LiteralPatternmight have some more expectedSyntaxErrorcases, like using*and/, using three numbers like0 + 0j + 0LiteralPatternsays:The singleton literals None, True and False are compared using the is operator., but onlyNoneis checked
I would like to send a PR with the new test cases.
Linked PRs
Metadata
Metadata
Assignees
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error