highlighter test

This commit is contained in:
Will McGugan 2020-04-26 16:34:55 +01:00
parent c9d148410e
commit c409f9f683
2 changed files with 9 additions and 1 deletions

View file

@ -47,7 +47,7 @@ class NullHighlighter(Highlighter):
"""
def highlight(self, text: Text) -> None:
pass
"""Nothing to do"""
class RegexHighlighter(Highlighter):

View file

@ -0,0 +1,8 @@
import pytest
from rich.highlighter import NullHighlighter
def test_wrong_type():
highlighter = NullHighlighter()
with pytest.raises(TypeError):
highlighter([])