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

Function test_from_path_unknown_lexer

tests/test_syntax.py:331–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

329
330@skip_windows_permission_error
331def test_from_path_unknown_lexer() -> None:
332 fh, path = tempfile.mkstemp("example.nosuchtype")
333 try:
334 os.write(fh, b"import this\n")
335 syntax = Syntax.from_path(path)
336 assert syntax.lexer is None
337 assert syntax.code == "import this\n"
338 finally:
339 os.remove(path)
340
341
342@skip_windows_permission_error

Callers

nothing calls this directly

Calls 2

from_pathMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected