From c1055cecda5b14caa8b962ccab51f04f38f96289 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 23 Jan 2021 14:47:35 +0000 Subject: [PATCH] coverage --- rich/text.py | 2 +- tests/test_text.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rich/text.py b/rich/text.py index e03005e7..8f077fc3 100644 --- a/rich/text.py +++ b/rich/text.py @@ -949,7 +949,7 @@ class Text(JupyterMixin): append_span(line_span) position -= 1 if position < 0 or not span_stack: - break + break # pragma: no cover line._spans.sort(key=get_order) return new_lines diff --git a/tests/test_text.py b/tests/test_text.py index 5281fbea..d7d3afce 100644 --- a/tests/test_text.py +++ b/tests/test_text.py @@ -307,12 +307,12 @@ def test_split(): def test_split_spans(): - test = Text.from_markup("[red]Hello\nWorld") + test = Text.from_markup("[red]Hello\n[b]World") lines = test.split("\n") assert lines[0].plain == "Hello" assert lines[1].plain == "World" assert lines[0].spans == [Span(0, 5, "red")] - assert lines[1].spans == [Span(0, 5, "red")] + assert lines[1].spans == [Span(0, 5, "red"), Span(0, 5, "bold")] def test_divide():