Skip to content

Commit 12092bd

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

File tree

1 file changed

+40
-22
lines changed

1 file changed

+40
-22
lines changed

tests/test_settings_docs.py

+40-22
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,58 @@
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
22+
# Deprecated items are not included here
23+
assert "ninja.minimum-version" not in docs
1624

1725

18-
def test_mk_docs() -> None:
19-
docs = set(mk_docs(ScikitBuildSettings))
20-
26+
def test_skbuild_docs_sphinx() -> None:
27+
docs = mk_skbuild_docs_sphinx()
2128
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-
)
29+
textwrap.dedent("""\
30+
.. confval:: cmake.define
31+
:type: ``EnvVar``
32+
33+
A table of defines to pass to CMake when configuring the project. Additive.
34+
""")
2935
in docs
3036
)
3137
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-
)
38+
textwrap.dedent("""\
39+
.. confval:: ninja.minimum-version
40+
:type: ``Version``
41+
42+
DEPRECATED in 0.8; use version instead.
43+
""")
3944
in docs
4045
)
46+
47+
48+
def test_mk_docs() -> None:
49+
docs = set(mk_docs(ScikitBuildSettings))
50+
51+
dcdoc = next(item for item in docs if item.name == "cmake.define")
52+
assert dcdoc.type == "EnvVar"
53+
assert dcdoc.default == "{}"
54+
assert (
55+
dcdoc.docs
56+
== "A table of defines to pass to CMake when configuring the project. Additive."
57+
)
58+
assert dcdoc.deprecated is False

0 commit comments

Comments
 (0)