File tree 1 file changed +10
-4
lines changed
1 file changed +10
-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,16 @@ 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 ""
277
283
EXPECTED = '\n ' .join ([
278
284
"``IEmpty``" ,
279
285
"" ,
280
286
" This is an empty interface." ,
281
287
" " ,
282
- (" It can be used to annotate any class or object, "
288
+ (f" { indent } It can be used to annotate any class or object, "
283
289
"because it promises" ),
284
- " nothing." ,
290
+ f" { indent } nothing." ,
285
291
"" ,
286
292
" Attributes:" ,
287
293
"" ,
You can’t perform that action at this time.
0 commit comments