Skip to content

Commit

Permalink
# fmt: off for Black
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw authored Jan 10, 2024
1 parent b0a2ac6 commit 35c3fbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sphinx/literalinclude-with-markers.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Note that the paths like `../tests/test_docs.py` are relative to the root `docs/

Then in [tests/test_docs.py](https://github.com/simonw/datasette/blob/0f63cb83ed31753a9bd9ec5cc71de16906767337/tests/test_docs.py#L109-L141):
```python
# fmt: off

# -- start test_homepage --
@pytest.mark.asyncio
async def test_homepage():
Expand Down Expand Up @@ -58,3 +60,5 @@ async def test_signed_cookie_actor():
# -- end test_signed_cookie_actor --
```
The rendered documentation [can be seen here](https://docs.datasette.io/en/latest/testing_plugins.html#using-datasette-client-in-tests).

The `# fmt: off` line at the start is an instruction to [Black](https://github.com/psf/black) to ignore that section of the file. Without that, running Black would insist on adding newlines before the closing `# -- end` comments, which would show up [as blank space in the documents](https://github.com/simonw/datasette/issues/2231).

0 comments on commit 35c3fbd

Please sign in to comment.