Skip to content

Commit

Permalink
Fix tests on Python 3.7
Browse files Browse the repository at this point in the history
Python 3.7 doesn't support reading signatures from `__text_signature__`
for non-builtin functions (i.e. C/Rust functions). For testing we're using
regular Python syntax for defining signature.
  • Loading branch information
unexge committed Jan 9, 2023
1 parent 1aaacf1 commit 580ae56
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,13 @@ def foo(bar: str) -> bool:
def test_function_with_default_value(self):
self.single_mod(
"""
def foo(bar):
def foo(bar, qux=None):
'''
:param bar int:
:param qux typing.Optional[str]:
:rtype None:
'''
pass
foo.__text_signature__ = '(bar, qux=None)'
""",
"""
import typing
Expand Down

0 comments on commit 580ae56

Please sign in to comment.