Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Positional arguments displayed incorrectly in error messages #69

Open
ollipa opened this issue Aug 22, 2021 · 0 comments
Open

Positional arguments displayed incorrectly in error messages #69

ollipa opened this issue Aug 22, 2021 · 0 comments
Labels

Comments

@ollipa
Copy link
Member

ollipa commented Aug 22, 2021

Positional arguments displayed incorrectly in error messages. Just a cosmetic bug and nothing critical.

Reproducing code:

from flexmock import flexmock

class Foo:
    def method1(self, a, **kwargs):
        pass

foo = Foo()
flexmock(foo).should_receive("method1").with_args(1, arg3=3, arg2=2)
foo.method1(arg2=2, arg3=3)

Should display error message:

flexmock.exceptions.MethodSignatureError: Arguments for call method1 did not match expectations:
  Received call:        method1(arg2=2, arg3=3)
  Expected call[1]:     method1(1, arg3=3, arg2=2)

But has error message:

flexmock.exceptions.MethodSignatureError: Arguments for call method1 did not match expectations:
  Received call:        method1(arg2=2, arg3=3)
  Expected call[1]:     method1(arg3=3, arg2=2, a=1)
                                               # ^ positional argument displayed after keyword arguments
@ollipa ollipa added the bug label Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant