Skip to content

Commit

Permalink
Fix signature of return_ and raise_
Browse files Browse the repository at this point in the history
This is an oversight of patch 74c3c9b (Avoid `partial` when constructing
answers).  We had the catch all arguments because we used `partial` on
the functions.  Since we now don't, there is actually no use for them.
They look rather confusing, as if the intention would be to eat all but
the first argument.

Hence, the cleanup.
  • Loading branch information
kaste committed Jan 24, 2025
1 parent fbb9a5f commit 939cd48
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mockito/invocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ def check_used(self):
"\nUnused stub: %s" % self)


def return_(value, *a, **kw):
def answer(*a, **kw):
def return_(value):
def answer(*args, **kwargs):
return value
return answer

def raise_(exception, *a, **kw):
def answer(*a, **kw):
def raise_(exception):
def answer(*args, **kwargs):
raise exception
return answer

Expand Down

0 comments on commit 939cd48

Please sign in to comment.