Skip to content

Commit

Permalink
feat: Stubbed sphinx-extension with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed May 1, 2024
1 parent 6fc59e4 commit 2172d20
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rst_budoux/sphinx.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
"""Implementation as Sphinx-extension."""

from sphinx.application import Sphinx

from . import __version__


def setup(app: Sphinx): # noqa: D103
return {
"version": __version__,
"env_version": 1,
"parallel_read_safe": True,
"parallel_write_safe": True,
}
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Configuration for pytest."""

import pytest
from sphinx.testing.path import path

pytest_plugins = "sphinx.testing.fixtures"


@pytest.fixture(scope="session")
def rootdir() -> path: # noqa: D103
return (path(__file__).parent / "doc-targets").abspath()
5 changes: 5 additions & 0 deletions tests/doc-targets/test-root/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# noqa: D100

extensions = [
"rst_budoux.sphinx",
]
3 changes: 3 additions & 0 deletions tests/doc-targets/test-root/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Test doc for rst-budoux
=======================

10 changes: 10 additions & 0 deletions tests/test_sphinx.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Standard tests as Sphinx-extension."""

import pytest
from sphinx.testing.util import SphinxTestApp


@pytest.mark.sphinx("html")
def test__it(app: SphinxTestApp):
"""Test that it passes with rst-budoux extension."""
app.build()

0 comments on commit 2172d20

Please sign in to comment.