Commit 5d42886 1 parent 202d9dc commit 5d42886 Copy full SHA for 5d42886
File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 13
13
##############################################################################
14
14
"""Documentation tests.
15
15
"""
16
+ import sys
16
17
import unittest
17
18
18
19
@@ -50,14 +51,17 @@ class IEmpty(Interface):
50
51
51
52
def test_asStructuredText_empty_with_multiline_docstring (self ):
52
53
from zope .interface import Interface
54
+ # In Python 3.13+, compiler strips indents from docstrings
55
+ indent = " " * 12 if sys .version_info < (3 , 13 ) else ""
56
+
53
57
EXPECTED = '\n ' .join ([
54
58
"IEmpty" ,
55
59
"" ,
56
60
" This is an empty interface." ,
57
61
" " ,
58
- (" It can be used to annotate any class or object, "
62
+ (f" { indent } It can be used to annotate any class or object, "
59
63
"because it promises" ),
60
- " nothing." ,
64
+ f" { indent } nothing." ,
61
65
"" ,
62
66
" Attributes:" ,
63
67
"" ,
@@ -274,14 +278,17 @@ class IEmpty(Interface):
274
278
275
279
def test_asReStructuredText_empty_with_multiline_docstring (self ):
276
280
from zope .interface import Interface
281
+ # In Python 3.13+, compiler strips indents from docstrings
282
+ indent = " " * 12 if sys .version_info < (3 , 13 ) else ""
283
+
277
284
EXPECTED = '\n ' .join ([
278
285
"``IEmpty``" ,
279
286
"" ,
280
287
" This is an empty interface." ,
281
288
" " ,
282
- (" It can be used to annotate any class or object, "
289
+ (f" { indent } It can be used to annotate any class or object, "
283
290
"because it promises" ),
284
- " nothing." ,
291
+ f" { indent } nothing." ,
285
292
"" ,
286
293
" Attributes:" ,
287
294
"" ,
You can’t perform that action at this time.
0 commit comments