Skip to content

Commit 662476a

Browse files
Add missing assert (#167)
* Add missing assert * Fix docstring test for Python 3.13 * Fix older Python version
1 parent bdae6e3 commit 662476a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

betterproto2/tests/test_documentation.py

Lines changed: 14 additions & 1 deletion
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-
ComplexDocumentation.__doc__ == """
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+
== """
4759
A comment with backslashes \\ and triple quotes \"\"\"
4860
Simple quotes are not escaped "
4961
"""
62+
)

0 commit comments

Comments
 (0)