summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_build_manpage.py12
-rw-r--r--tests/test_util_typing.py11
2 files changed, 21 insertions, 2 deletions
diff --git a/tests/test_build_manpage.py b/tests/test_build_manpage.py
index 3680d8651..e2479e4de 100644
--- a/tests/test_build_manpage.py
+++ b/tests/test_build_manpage.py
@@ -23,6 +23,9 @@ def test_all(app, status, warning):
assert r'\fBprint \fP\fIi\fP\fB\en\fP' in content
assert r'\fBmanpage\en\fP' in content
+ # heading (title + description)
+ assert r'sphinxtests \- Sphinx <Tests> 0.6alpha1' in content
+
# term of definition list including nodes.strong
assert '\n.B term1\n' in content
assert '\nterm2 (\\fBstronged partially\\fP)\n' in content
@@ -36,6 +39,15 @@ def test_all(app, status, warning):
@pytest.mark.sphinx('man', testroot='basic',
+ confoverrides={'man_pages': [('index', 'title', None, [], 1)]})
+def test_man_pages_empty_description(app, status, warning):
+ app.builder.build_all()
+
+ content = (app.outdir / 'title.1').read_text()
+ assert r'title \-' not in content
+
+
+@pytest.mark.sphinx('man', testroot='basic',
confoverrides={'man_make_section_directory': True})
def test_man_make_section_directory(app, status, warning):
app.build()
diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py
index 9cb1d61ef..bbee68f82 100644
--- a/tests/test_util_typing.py
+++ b/tests/test_util_typing.py
@@ -113,7 +113,11 @@ def test_restify_type_hints_typevars():
assert restify(T_co) == ":obj:`tests.test_util_typing.T_co`"
assert restify(T_contra) == ":obj:`tests.test_util_typing.T_contra`"
assert restify(List[T]) == ":class:`~typing.List`\\ [:obj:`tests.test_util_typing.T`]"
- assert restify(MyInt) == ":class:`MyInt`"
+
+ if sys.version_info >= (3, 10):
+ assert restify(MyInt) == ":class:`tests.test_util_typing.MyInt`"
+ else:
+ assert restify(MyInt) == ":class:`MyInt`"
def test_restify_type_hints_custom_class():
@@ -250,7 +254,10 @@ def test_stringify_type_hints_typevars():
assert stringify(T_contra) == "tests.test_util_typing.T_contra"
assert stringify(List[T]) == "List[tests.test_util_typing.T]"
- assert stringify(MyInt) == "MyInt"
+ if sys.version_info >= (3, 10):
+ assert stringify(MyInt) == "tests.test_util_typing.MyInt"
+ else:
+ assert stringify(MyInt) == "MyInt"
def test_stringify_type_hints_custom_class():