()
| 329 | |
| 330 | @skip_windows_permission_error |
| 331 | def 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 |