Skip to content

Commit

Permalink
Added simple test corresponding to #55
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain MARIE committed May 27, 2020
1 parent 52e0885 commit 3a1b52a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions makefun/tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,28 @@ def __init__(self, *args, **kwargs):
super(Bar, self).__init__(*args, **kwargs)

b = Bar(2)


def test_issue_55():
"""Tests that no syntax error appears when no arguments are provided in the signature (name change scenario)"""

# full name change including stack trace

@with_signature('bar()')
def foo():
return 'a'

assert "bar at" in repr(foo)
assert foo.__name__ == 'bar'
assert foo() == 'a'

# only metadata change

@with_signature(None, func_name='bar')
def foo():
return 'a'

if sys.version_info >= (3, 0):
assert "foo at" in repr(foo)
assert foo.__name__ == 'bar'
assert foo() == 'a'

0 comments on commit 3a1b52a

Please sign in to comment.