()
| 316 | |
| 317 | @skip_windows_permission_error |
| 318 | def 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 |