Skip to content

Commit 9f0b87f

Browse files
committed
Make recently introduced doctest work on different Python versions
I think the test failure may be caused by recent Python dedenting docstrings (see python/cpython#81283).
1 parent 207395c commit 9f0b87f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pglast/__init__.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ def parse_plpgsql(statement):
7979
as_sql = parse_sql(STMT)
8080
pprint([stmt(skip_none=True) for stmt in as_sql])
8181
82-
you obtain a richer representation of the statement:
82+
you obtain a richer representation\\[#]_ of the statement:
8383
8484
.. testoutput::
85-
:options: -ELLIPSIS
85+
:options: +ELLIPSIS
8686
8787
[{'@': 'RawStmt',
8888
'stmt': {'@': 'CreateFunctionStmt',
@@ -95,17 +95,17 @@ def parse_plpgsql(statement):
9595
'name': 'DEFELEM_UNSPEC',
9696
'value': 0},
9797
'defname': 'as',
98-
'location': 68},
98+
'location': ...},
9999
{'@': 'DefElem',
100100
'arg': {'@': 'String', 'sval': 'plpgsql'},
101101
'defaction': {'#': 'DefElemAction',
102102
'name': 'DEFELEM_UNSPEC',
103103
'value': 0},
104104
'defname': 'language',
105-
'location': 104}),
105+
'location': ...}),
106106
'parameters': ({'@': 'FunctionParameter',
107107
'argType': {'@': 'TypeName',
108-
'location': 32,
108+
'location': ...,
109109
'names': ({'@': 'String',
110110
'sval': 'pg_catalog'},
111111
{'@': 'String',
@@ -119,7 +119,7 @@ def parse_plpgsql(statement):
119119
'name': 'a'},
120120
{'@': 'FunctionParameter',
121121
'argType': {'@': 'TypeName',
122-
'location': 43,
122+
'location': ...,
123123
'names': ({'@': 'String',
124124
'sval': 'pg_catalog'},
125125
{'@': 'String',
@@ -133,7 +133,7 @@ def parse_plpgsql(statement):
133133
'name': 'b'}),
134134
'replace': False,
135135
'returnType': {'@': 'TypeName',
136-
'location': 60,
136+
'location': ...,
137137
'names': ({'@': 'String', 'sval': 'pg_catalog'},
138138
{'@': 'String', 'sval': 'int4'}),
139139
'pct_type': False,
@@ -143,6 +143,7 @@ def parse_plpgsql(statement):
143143
'stmt_location': 0}]
144144
145145
.. [#] See also https://github.com/pganalyze/libpg_query/issues/110.
146+
.. [#] ``location`` values has been masqueraded for test purposes.
146147
"""
147148

148149
from json import loads

0 commit comments

Comments
 (0)