MCPcopy
hub / github.com/Textualize/rich / test_get_style_for_token

Function test_get_style_for_token

tests/test_syntax.py:212–230  ·  tests/test_syntax.py::test_get_style_for_token
()

Source from the content-addressed store, hash-verified

210
211
212def test_get_style_for_token() -> None:
213 class="cm"># from pygments.style import Style as PygmentsStyle
214 class="cm"># pygments_style = PygmentsStyle()
215 from pygments.style import Token
216
217 style = PygmentsSyntaxTheme(class="st">"default")
218 style_dict = {Token.Text: Style(color=None)}
219 style._style_cache = style_dict
220 syntax = Syntax(
221 CODE,
222 lexer=class="st">"python",
223 line_numbers=True,
224 line_range=(2, 10),
225 theme=style,
226 code_width=60,
227 word_wrap=True,
228 background_color=class="st">"red",
229 )
230 assert syntax._get_line_numbers_color() == Color.default()
231
232
233def test_option_no_wrap() -> None:

Callers

nothing calls this directly

Calls 5

PygmentsSyntaxThemeClass · 0.90
StyleClass · 0.90
SyntaxClass · 0.90
defaultMethod · 0.80

Tested by

no test coverage detected