Add more cases to test_patma
#106135
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
tests
Tests in the Lib/test dir
type-bug
An unexpected behavior, bug, or error
While anwsering #106133 I've noticed that
test_patma
does not have tests for some corner-cases: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 sameClassPattern
section PEP says:If name_or_attr is not an instance of the builtin type, TypeError is raised.
It is never tested inTestTypeErrors
LiteralPattern
might have some more expectedSyntaxError
cases, like using*
and/
, using three numbers like0 + 0j + 0
LiteralPattern
says:The singleton literals None, True and False are compared using the is operator.
, but onlyNone
is checkedI would like to send a PR with the new test cases.
Linked PRs
test_patma
with more cases #106271The text was updated successfully, but these errors were encountered: