coverage tweak

This commit is contained in:
Will McGugan 2020-03-09 21:43:29 +00:00
parent 094b3bfbc1
commit 535fe42def
3 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,8 @@
[run] [run]
omit = rich/python.py omit = rich/python.py
[report]
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if __name__ == "__main__":

View File

@ -98,7 +98,7 @@ class Table:
title: Union[str, Text] = None, title: Union[str, Text] = None,
caption: Union[str, Text] = None, caption: Union[str, Text] = None,
width: int = None, width: int = None,
box: Optional[box.Box] = box.SQUARE, box: Optional[box.Box] = box.HEAVY_HEAD,
padding: PaddingDimensions = (0, 1), padding: PaddingDimensions = (0, 1),
pad_edge: bool = True, pad_edge: bool = True,
expand: bool = False, expand: bool = False,

View File

@ -241,17 +241,18 @@ def test_right_crop():
assert test._spans == [Span(0, 3, "red")] assert test._spans == [Span(0, 3, "red")]
def test_wrap(): def test_wrap_4():
test = Text("foo bar baz") test = Text("foo bar baz")
lines = test.wrap(4) lines = test.wrap(4)
print(list(lines))
assert len(lines) == 3 assert len(lines) == 3
assert lines[0] == Text("foo ") assert lines[0] == Text("foo ")
assert lines[1] == Text("bar ") assert lines[1] == Text("bar ")
assert lines[2] == Text("baz ") assert lines[2] == Text("baz ")
def test_wrap_3():
test = Text("foo bar baz")
lines = test.wrap(3) lines = test.wrap(3)
print(list(lines))
assert len(lines) == 3 assert len(lines) == 3
assert lines[0] == Text("foo") assert lines[0] == Text("foo")
assert lines[1] == Text("bar") assert lines[1] == Text("bar")