diff --git a/src/zope/interface/tests/test_document.py b/src/zope/interface/tests/test_document.py index 3e6dddd8..f00e6311 100644 --- a/src/zope/interface/tests/test_document.py +++ b/src/zope/interface/tests/test_document.py @@ -13,6 +13,7 @@ ############################################################################## """Documentation tests. """ +import sys import unittest @@ -50,14 +51,17 @@ class IEmpty(Interface): def test_asStructuredText_empty_with_multiline_docstring(self): from zope.interface import Interface + # In Python 3.13+, compiler strips indents from docstrings + indent = " " * 12 if sys.version_info < (3, 13) else "" + EXPECTED = '\n'.join([ "IEmpty", "", " This is an empty interface.", " ", - (" It can be used to annotate any class or object, " + (f"{indent} It can be used to annotate any class or object, " "because it promises"), - " nothing.", + f"{indent} nothing.", "", " Attributes:", "", @@ -274,14 +278,17 @@ class IEmpty(Interface): def test_asReStructuredText_empty_with_multiline_docstring(self): from zope.interface import Interface + # In Python 3.13+, compiler strips indents from docstrings + indent = " " * 12 if sys.version_info < (3, 13) else "" + EXPECTED = '\n'.join([ "``IEmpty``", "", " This is an empty interface.", " ", - (" It can be used to annotate any class or object, " + (f"{indent} It can be used to annotate any class or object, " "because it promises"), - " nothing.", + f"{indent} nothing.", "", " Attributes:", "",