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

Function test_from_path

tests/test_syntax.py:318–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

316
317@skip_windows_permission_error
318def test_from_path() -> None:
319 fh, path = tempfile.mkstemp("example.py")
320 try:
321 os.write(fh, b"import this\n")
322 syntax = Syntax.from_path(path)
323 assert syntax.lexer
324 assert syntax.lexer.name == "Python"
325 assert syntax.code == "import this\n"
326 finally:
327 os.remove(path)
328
329
330@skip_windows_permission_error

Callers

nothing calls this directly

Calls 2

from_pathMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected