Skip to content

Commit 56e0d63

Browse files
committed
Fix docstring test for Python 3.13
1 parent 466173f commit 56e0d63

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

betterproto2/tests/test_documentation.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ast
22
import inspect
3+
import sys
34

45
from tests.util import requires_grpclib # noqa: F401
56

@@ -43,7 +44,19 @@ def test_documentation(requires_grpclib) -> None:
4344
def test_escaping(requires_grpclib) -> None:
4445
from .outputs.documentation.documentation import ComplexDocumentation
4546

46-
assert ComplexDocumentation.__doc__ == """
47-
A comment with backslashes \\ and triple quotes \"\"\"
48-
Simple quotes are not escaped "
49-
"""
47+
if sys.version_info >= (3, 13):
48+
assert (
49+
ComplexDocumentation.__doc__
50+
== """
51+
A comment with backslashes \\ and triple quotes \"\"\"
52+
Simple quotes are not escaped "
53+
"""
54+
)
55+
else:
56+
assert (
57+
ComplexDocumentation.__doc__
58+
== """
59+
A comment with backslashes \\ and triple quotes \"\"\"
60+
Simple quotes are not escaped "
61+
"""
62+
)

0 commit comments

Comments
 (0)