Skip to content

Commit 9c3e4cc

Browse files
committed
Change the test targets for the mk_docs tests
Signed-off-by: Cristian Le <[email protected]>
1 parent 5d7cc96 commit 9c3e4cc

File tree

1 file changed

+38
-22
lines changed

1 file changed

+38
-22
lines changed

tests/test_settings_docs.py

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,56 @@
11
from __future__ import annotations
22

3-
from scikit_build_core.settings.documentation import DCDoc, mk_docs
4-
from scikit_build_core.settings.skbuild_docs_readme import mk_skbuild_docs
3+
import textwrap
4+
5+
from scikit_build_core.settings.documentation import mk_docs
6+
from scikit_build_core.settings.skbuild_docs_readme import (
7+
mk_skbuild_docs as mk_skbuild_docs_readme,
8+
)
9+
from scikit_build_core.settings.skbuild_docs_sphinx import (
10+
mk_skbuild_docs as mk_skbuild_docs_sphinx,
11+
)
512
from scikit_build_core.settings.skbuild_model import ScikitBuildSettings
613

714

8-
def test_skbuild_docs() -> None:
9-
docs = mk_skbuild_docs()
15+
def test_skbuild_docs_readme() -> None:
16+
docs = mk_skbuild_docs_readme()
1017
assert (
1118
"A table of defines to pass to CMake when configuring the project. Additive."
1219
in docs
1320
)
14-
assert "DEPRECATED in 0.10, use build.verbose instead." in docs
1521
assert "fail = false" in docs
1622

1723

18-
def test_mk_docs() -> None:
19-
docs = set(mk_docs(ScikitBuildSettings))
20-
24+
def test_skbuild_docs_sphinx() -> None:
25+
docs = mk_skbuild_docs_sphinx()
2126
assert (
22-
DCDoc(
23-
name="cmake.minimum-version",
24-
type="Version",
25-
default='""',
26-
docs="DEPRECATED in 0.8; use version instead.",
27-
deprecated=True,
28-
)
27+
textwrap.dedent("""\
28+
.. confval:: cmake.define
29+
:type: ``EnvVar``
30+
31+
A table of defines to pass to CMake when configuring the project. Additive.
32+
""")
2933
in docs
3034
)
3135
assert (
32-
DCDoc(
33-
name="install.strip",
34-
type="bool",
35-
default="true",
36-
docs="Whether to strip the binaries. True for release builds on scikit-build-core 0.5+ (0.5-0.10.5 also incorrectly set this for debug builds).",
37-
deprecated=False,
38-
)
36+
textwrap.dedent("""\
37+
.. confval:: ninja.minimum-version
38+
:type: ``Version``
39+
40+
DEPRECATED in 0.8; use version instead.
41+
""")
3942
in docs
4043
)
44+
45+
46+
def test_mk_docs() -> None:
47+
docs = set(mk_docs(ScikitBuildSettings))
48+
49+
dcdoc = next(item for item in docs if item.name == "cmake.define")
50+
assert dcdoc.type == "EnvVar"
51+
assert dcdoc.default == "{}"
52+
assert (
53+
dcdoc.docs
54+
== "A table of defines to pass to CMake when configuring the project. Additive."
55+
)
56+
assert dcdoc.deprecated is False

0 commit comments

Comments
 (0)