mirror of
https://github.com/Textualize/rich.git
synced 2025-08-31 07:27:29 +00:00
highlighter test
This commit is contained in:
parent
c9d148410e
commit
c409f9f683
2 changed files with 9 additions and 1 deletions
|
@ -47,7 +47,7 @@ class NullHighlighter(Highlighter):
|
|||
"""
|
||||
|
||||
def highlight(self, text: Text) -> None:
|
||||
pass
|
||||
"""Nothing to do"""
|
||||
|
||||
|
||||
class RegexHighlighter(Highlighter):
|
||||
|
|
8
tests/test_highlighter.py
Normal file
8
tests/test_highlighter.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
import pytest
|
||||
from rich.highlighter import NullHighlighter
|
||||
|
||||
|
||||
def test_wrong_type():
|
||||
highlighter = NullHighlighter()
|
||||
with pytest.raises(TypeError):
|
||||
highlighter([])
|
Loading…
Add table
Add a link
Reference in a new issue