Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Feb 17, 2019
1 parent 1b8420b commit f6d866b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/test_add_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def test_disabled_logger_in_sink(sink_with_logger):

def test_invalid_function_kwargs():
def function(message, a="Y"):
pass
raise NotImplementedError

logger.add(function, b="X", catch=False)
with pytest.raises(TypeError):
Expand All @@ -384,7 +384,7 @@ def __init__(self):
self.out = ""

def write(self, m):
pass
raise NotImplementedError

writer = Writer()
logger.add(writer, format="{message}", kw1="1", kw2="2", catch=False)
Expand Down
3 changes: 1 addition & 2 deletions tests/test_threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def __init__(self, sleep_time):
self.stopped = False

def write(self, message):
if self.stopped:
raise RuntimeError("Can't write on stopped sink")
assert not self.stopped

length = len(message)
self.written += message[:length]
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ source = .

[coverage:report]
include = loguru/*, tests/*

exclude_lines =
\#\s*pragma: no cover
^\s*raise NotImplementedError\b

0 comments on commit f6d866b

Please sign in to comment.