-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Description
Hi. mypy returns an unreachable error for code after a pytets.raises
block:
$ cat t.py
import pytest
def testeroni() -> None:
with pytest.raises(Exception):
raise Exception("oh noes")
print("hello there")
$ mypy --version
mypy 0.780
$ mypy t.py
t.py: note: In function "testeroni":
t.py:7: error: Statement is unreachable
print("hello there")
^
Found 1 error in 1 file (checked 1 source file)
I'm actually not sure if this is a bug in mypy, since it might not be aware that pytest swallows the exception there. Any advice appreciated!
Metadata
Metadata
Assignees
Labels
No labels