Skip to content

Commit

Permalink
Add regression test for #5288 (#8385)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Mar 7, 2023
1 parent b4fe93a commit ca25497
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/whatsnew/fragments/5288.false_positive
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Fix various false positives for functions that return directly from
structural pattern matching cases.

Closes #5288
11 changes: 11 additions & 0 deletions tests/functional/u/unpacking/unpacking_non_sequence_py310.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Test returns from structural pattern matching cases."""

def unpack(num) -> tuple[int, int]:
"""Return a tuple of integers."""
match num:
case 1:
return 1, 1
case _:
return 0, 0

x, y = unpack(1)
2 changes: 2 additions & 0 deletions tests/functional/u/unpacking/unpacking_non_sequence_py310.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[testoptions]
min_pyver=3.10

0 comments on commit ca25497

Please sign in to comment.