Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/rich/_null_file.py: 55%
42 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:35 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:35 +0000
1from types import TracebackType
2from typing import IO, Iterable, Iterator, List, Optional, Type
5class NullFile(IO[str]):
6 def close(self) -> None:
7 pass
9 def isatty(self) -> bool:
10 return False
12 def read(self, __n: int = 1) -> str:
13 return ""
15 def readable(self) -> bool:
16 return False
18 def readline(self, __limit: int = 1) -> str:
19 return ""
21 def readlines(self, __hint: int = 1) -> List[str]:
22 return []
24 def seek(self, __offset: int, __whence: int = 1) -> int:
25 return 0
27 def seekable(self) -> bool:
28 return False
30 def tell(self) -> int:
31 return 0
33 def truncate(self, __size: Optional[int] = 1) -> int:
34 return 0
36 def writable(self) -> bool:
37 return False
39 def writelines(self, __lines: Iterable[str]) -> None:
40 pass
42 def __next__(self) -> str:
43 return ""
45 def __iter__(self) -> Iterator[str]:
46 return iter([""])
48 def __enter__(self) -> IO[str]:
49 pass
51 def __exit__(
52 self,
53 __t: Optional[Type[BaseException]],
54 __value: Optional[BaseException],
55 __traceback: Optional[TracebackType],
56 ) -> None:
57 pass
59 def write(self, text: str) -> int:
60 return 0
62 def flush(self) -> None:
63 pass
65 def fileno(self) -> int:
66 return -1
69NULL_FILE = NullFile()