Skip to content

Commit

Permalink
use Optional
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Nov 2, 2019
1 parent 0b6f6af commit 0a19adf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/_pytest/capture.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from tempfile import TemporaryFile
from typing import Callable
from typing import List
from typing import Optional

import pytest
from _pytest.compat import CaptureIO
Expand Down Expand Up @@ -464,7 +465,12 @@ class MultiCapture:
_state = None

def __init__(
self, out=True, err=True, in_=True, Capture=None, capman: CaptureManager = None
self,
out=True,
err=True,
in_=True,
Capture=None,
capman: Optional[CaptureManager] = None,
):
if in_:
self.in_ = Capture(0, capman=capman)
Expand Down Expand Up @@ -554,7 +560,7 @@ class FDCaptureBinary:
EMPTY_BUFFER = b""
_state = None

def __init__(self, targetfd, tmpfile=None, capman: CaptureManager = None):
def __init__(self, targetfd, tmpfile=None, capman: Optional[CaptureManager] = None):
self.targetfd = targetfd
self._capman = capman
try:
Expand Down Expand Up @@ -667,7 +673,7 @@ class SysCapture:
EMPTY_BUFFER = str()
_state = None

def __init__(self, fd, tmpfile=None, capman: CaptureManager = None):
def __init__(self, fd, tmpfile=None, capman: Optional[CaptureManager] = None):
name = patchsysdict[fd]
self._capman = capman
self._old = getattr(sys, name)
Expand Down

0 comments on commit 0a19adf

Please sign in to comment.