summaryrefslogtreecommitdiff
path: root/src/_pytest/compat.py
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2020-02-04 09:49:11 +0100
committerRan Benita <ran@unusedvar.com>2020-05-05 21:24:59 +0300
commit7647d1c836274497d60c2830cc9a3f0698af52a2 (patch)
tree280f610bd9d5962f1d603a9d64516ac0df3a2b4a /src/_pytest/compat.py
parent80e509840813cb5da45fbe830718ea3707c02b25 (diff)
downloadpytest-7647d1c836274497d60c2830cc9a3f0698af52a2.tar.gz
Move Capture classes from compat to capture and improve naming
Move {Passthrough,CaptureIO} to capture module, and rename Passthrough -> Tee to match the existing terminology. Co-authored-by: Ran Benita <ran@unusedvar.com>
Diffstat (limited to 'src/_pytest/compat.py')
-rw-r--r--src/_pytest/compat.py21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/_pytest/compat.py b/src/_pytest/compat.py
index cf051182f..ba225eb8f 100644
--- a/src/_pytest/compat.py
+++ b/src/_pytest/compat.py
@@ -3,7 +3,6 @@ python version compatibility code
"""
import functools
import inspect
-import io
import os
import re
import sys
@@ -13,7 +12,6 @@ from inspect import signature
from typing import Any
from typing import Callable
from typing import Generic
-from typing import IO
from typing import Optional
from typing import overload
from typing import Tuple
@@ -343,25 +341,6 @@ def safe_isclass(obj: object) -> bool:
return False
-class CaptureIO(io.TextIOWrapper):
- def __init__(self) -> None:
- super().__init__(io.BytesIO(), encoding="UTF-8", newline="", write_through=True)
-
- def getvalue(self) -> str:
- assert isinstance(self.buffer, io.BytesIO)
- return self.buffer.getvalue().decode("UTF-8")
-
-
-class CaptureAndPassthroughIO(CaptureIO):
- def __init__(self, other: IO) -> None:
- self._other = other
- super().__init__()
-
- def write(self, s) -> int:
- super().write(s)
- return self._other.write(s)
-
-
if sys.version_info < (3, 5, 2):
def overload(f): # noqa: F811