From ea7273a2ee403ba8cf5e14c132db206c8f425c72 Mon Sep 17 00:00:00 2001 From: Dominic Davis-Foster Date: Mon, 11 Dec 2023 09:28:29 +0000 Subject: [PATCH] Update test_sphinxify_docstring for Python 3.13 --- tests/test_doctools.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_doctools.py b/tests/test_doctools.py index c47cd2fa..55358b41 100644 --- a/tests/test_doctools.py +++ b/tests/test_doctools.py @@ -8,6 +8,7 @@ # stdlib import math +import sys from typing import Iterable, NamedTuple, get_type_hints # 3rd party @@ -353,7 +354,16 @@ def demo_function(): return math.pi - assert demo_function.__doc__ == """ + if sys.version_info >= (3, 13): + assert demo_function.__doc__ == """ +This is a docstring that contains references to :class:`str`, :class:`int`, and :class:`float` +but lacks proper references to them when rendered in Sphinx. + +:return: pi +:rtype: float +""" + else: + assert demo_function.__doc__ == """ This is a docstring that contains references to :class:`str`, :class:`int`, and :class:`float` but lacks proper references to them when rendered in Sphinx.