From 8c53dbf9d746292a36160d290c77a350533cbdba Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 21 Jan 2023 11:00:25 +0200 Subject: [PATCH] capture: fix pyright type error This is OK in mypy, but doesn't hurt to fix. --- src/_pytest/capture.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/_pytest/capture.py b/src/_pytest/capture.py index 4b838604e..275322cc3 100644 --- a/src/_pytest/capture.py +++ b/src/_pytest/capture.py @@ -36,6 +36,7 @@ from _pytest.nodes import File from _pytest.nodes import Item if TYPE_CHECKING: + from typing_extensions import Final from typing_extensions import Literal _CaptureMethod = Literal["fd", "sys", "no", "tee-sys"] @@ -723,7 +724,7 @@ class CaptureManager: """ def __init__(self, method: "_CaptureMethod") -> None: - self._method = method + self._method: Final = method self._global_capturing: Optional[MultiCapture[str]] = None self._capture_fixture: Optional[CaptureFixture[Any]] = None