Skip to content

Commit

Permalink
Make recently introduced doctest work on different Python versions
Browse files Browse the repository at this point in the history
I think the test failure may be caused by recent Python dedenting
docstrings (see python/cpython#81283).
  • Loading branch information
lelit committed Sep 30, 2024
1 parent 207395c commit 9f0b87f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions pglast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def parse_plpgsql(statement):
as_sql = parse_sql(STMT)
pprint([stmt(skip_none=True) for stmt in as_sql])
you obtain a richer representation of the statement:
you obtain a richer representation\\[#]_ of the statement:
.. testoutput::
:options: -ELLIPSIS
:options: +ELLIPSIS
[{'@': 'RawStmt',
'stmt': {'@': 'CreateFunctionStmt',
Expand All @@ -95,17 +95,17 @@ def parse_plpgsql(statement):
'name': 'DEFELEM_UNSPEC',
'value': 0},
'defname': 'as',
'location': 68},
'location': ...},
{'@': 'DefElem',
'arg': {'@': 'String', 'sval': 'plpgsql'},
'defaction': {'#': 'DefElemAction',
'name': 'DEFELEM_UNSPEC',
'value': 0},
'defname': 'language',
'location': 104}),
'location': ...}),
'parameters': ({'@': 'FunctionParameter',
'argType': {'@': 'TypeName',
'location': 32,
'location': ...,
'names': ({'@': 'String',
'sval': 'pg_catalog'},
{'@': 'String',
Expand All @@ -119,7 +119,7 @@ def parse_plpgsql(statement):
'name': 'a'},
{'@': 'FunctionParameter',
'argType': {'@': 'TypeName',
'location': 43,
'location': ...,
'names': ({'@': 'String',
'sval': 'pg_catalog'},
{'@': 'String',
Expand All @@ -133,7 +133,7 @@ def parse_plpgsql(statement):
'name': 'b'}),
'replace': False,
'returnType': {'@': 'TypeName',
'location': 60,
'location': ...,
'names': ({'@': 'String', 'sval': 'pg_catalog'},
{'@': 'String', 'sval': 'int4'}),
'pct_type': False,
Expand All @@ -143,6 +143,7 @@ def parse_plpgsql(statement):
'stmt_location': 0}]
.. [#] See also https://github.com/pganalyze/libpg_query/issues/110.
.. [#] ``location`` values has been masqueraded for test purposes.
"""

from json import loads
Expand Down

0 comments on commit 9f0b87f

Please sign in to comment.