Skip to content

Commit 61e57c7

Browse files
committed
Updating coverage excludes
1 parent 3c59f4a commit 61e57c7

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

domdf_python_tools/dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def get_timezone(tz: str, date: Optional[datetime.datetime] = None) -> Optional[
8787

8888
return pytz.timezone(tz).localize(d).tzinfo
8989

90-
except ImportError as e:
90+
except ImportError as e: # pragma: no cover
9191

9292
# stdlib
9393
import warnings

domdf_python_tools/terminal.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def clear() -> None:
7979
Works for Windows and POSIX, but does not clear the Python Interpreter or PyCharm's Console.
8080
"""
8181

82-
if os.name == "nt":
82+
if os.name == "nt": # pragma: no cover (!Windows)
8383
os.system("cls")
84-
else:
84+
else: # pragma: no cover (!Linux)
8585
print("\033c", end='')
8686

8787

@@ -104,7 +104,7 @@ def interrupt() -> None:
104104
print(f"(Press Ctrl-{'C' if os.name == 'nt' else 'D'} to quit at any time.)")
105105

106106

107-
def overtype(*objects, sep: str = ' ', end: str = '', file=sys.stdout, flush: bool = False) -> None:
107+
def overtype(*objects, sep: str = ' ', end: str = '', file=None, flush: bool = False) -> None:
108108
"""
109109
Print ``objects`` to the text stream ``file``, starting with ``"\\r"``, separated by ``sep``
110110
and followed by ``end``.
@@ -236,20 +236,21 @@ def ioctl_GWINSZ(fd):
236236
class Echo:
237237
"""
238238
Context manager for echoing variable assignments (in CPython).
239+
240+
:param indent: The indentation of the dictionary of variable assignments.
241+
:type indent: str, optional
239242
"""
240243

241-
def __init__(self, msg: str, indent: str = " "):
242-
self.msg = msg
244+
def __init__(self, indent: str = " "):
243245
self.indent = indent
244246

245247
frame = inspect.currentframe()
246-
if frame is None:
248+
if frame is None: # pragma: no cover
247249
raise ValueError("Unable to obtain the frame of the caller.")
248250
else:
249251
self.parent_frame = inspect.currentframe().f_back # type: ignore # TODO
250252

251253
def __enter__(self):
252-
print(self.msg)
253254
self.locals_on_entry = self.parent_frame.f_locals.copy()
254255

255256
def __exit__(self, exc_t, exc_v, tb):

0 commit comments

Comments
 (0)