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

Function test_from_path_lexer_override

tests/test_syntax.py:343–351  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342@skip_windows_permission_error
343def test_from_path_lexer_override() -> None:
344 fh, path = tempfile.mkstemp("example.nosuchtype")
345 try:
346 os.write(fh, b"import this\n")
347 syntax = Syntax.from_path(path, lexer="rust")
348 assert syntax.lexer.name == "Rust"
349 assert syntax.code == "import this\n"
350 finally:
351 os.remove(path)
352
353
354@skip_windows_permission_error

Callers

nothing calls this directly

Calls 2

from_pathMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected