Closed
Description
""" Unit tests. """
from types import TracebackType
from typing import Optional, Type
class TestManager:
def __enter__(self) -> None:
...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool:
...
def func() -> int:
with TestManager():
return 1
Mypy will complain about func()
, saying it doesn't have a return statement.
tests/__init__.py:16:1: error: Missing return statement
Is this intended?
Note: I also tried class TestManager(ContextManager[None]):
just to see if that would help mypy but it didn't change anything.