(tmp_path: Path)
| 365 | |
| 366 | |
| 367 | def test_excinfo_no_python_sourcecode(tmp_path: Path) -> None: |
| 368 | # XXX: simplified locally testable version |
| 369 | tmp_path.joinpath("test.txt").write_text("{{ h()}}:") |
| 370 | |
| 371 | jinja2 = pytest.importorskip("jinja2") |
| 372 | loader = jinja2.FileSystemLoader(str(tmp_path)) |
| 373 | env = jinja2.Environment(loader=loader) |
| 374 | template = env.get_template("test.txt") |
| 375 | excinfo = pytest.raises(ValueError, template.render, h=h) |
| 376 | for item in excinfo.traceback: |
| 377 | print(item) # XXX: for some reason jinja.Template.render is printed in full |
| 378 | item.source # shouldn't fail |
| 379 | if isinstance(item.path, Path) and item.path.name == "test.txt": |
| 380 | assert str(item.source) == "{{ h()}}:" |
| 381 | |
| 382 | |
| 383 | def test_entrysource_Queue_example(): |
nothing calls this directly
no outgoing calls
no test coverage detected