Skip to content

Commit 5042501

Browse files
committed
TEMP(?): typing: Optional in sigs #6036
1 parent ee530b9 commit 5042501

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/_pytest/capture.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from tempfile import TemporaryFile
1313
from typing import Callable
1414
from typing import List
15+
from typing import Optional
1516

1617
import pytest
1718
from _pytest.compat import CaptureIO
@@ -464,7 +465,12 @@ class MultiCapture:
464465
_state = None
465466

466467
def __init__(
467-
self, out=True, err=True, in_=True, Capture=None, capman: CaptureManager = None
468+
self,
469+
out=True,
470+
err=True,
471+
in_=True,
472+
Capture=None,
473+
capman: Optional[CaptureManager] = None,
468474
):
469475
if in_:
470476
self.in_ = Capture(0, capman=capman)
@@ -554,7 +560,7 @@ class FDCaptureBinary:
554560
EMPTY_BUFFER = b""
555561
_state = None
556562

557-
def __init__(self, targetfd, tmpfile=None, capman: CaptureManager = None):
563+
def __init__(self, targetfd, tmpfile=None, capman: Optional[CaptureManager] = None):
558564
self.targetfd = targetfd
559565
self._capman = capman
560566
try:
@@ -667,7 +673,7 @@ class SysCapture:
667673
EMPTY_BUFFER = str()
668674
_state = None
669675

670-
def __init__(self, fd, tmpfile=None, capman: CaptureManager = None):
676+
def __init__(self, fd, tmpfile=None, capman: Optional[CaptureManager] = None):
671677
name = patchsysdict[fd]
672678
self._capman = capman
673679
self._old = getattr(sys, name)

0 commit comments

Comments
 (0)