(fixture_def: fixtures.FixtureDef[object])
| 1488 | return bestrelpath(curdir, Path(loc)) |
| 1489 | |
| 1490 | def write_fixture(fixture_def: fixtures.FixtureDef[object]) -> None: |
| 1491 | argname = fixture_def.argname |
| 1492 | if verbose <= 0 and argname.startswith("_"): |
| 1493 | return |
| 1494 | prettypath = _pretty_fixture_path(fixture_def.func) |
| 1495 | tw.write(f"{argname}", green=True) |
| 1496 | tw.write(f" -- {prettypath}", yellow=True) |
| 1497 | tw.write("\n") |
| 1498 | fixture_doc = inspect.getdoc(fixture_def.func) |
| 1499 | if fixture_doc: |
| 1500 | write_docstring( |
| 1501 | tw, fixture_doc.split("\n\n")[0] if verbose <= 0 else fixture_doc |
| 1502 | ) |
| 1503 | else: |
| 1504 | tw.line(" no docstring available", red=True) |
| 1505 | |
| 1506 | def write_item(item: nodes.Item) -> None: |
| 1507 | # Not all items have _fixtureinfo attribute. |
no test coverage detected