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

Spying child class with_args does not work after spying the base class #79

Open
ollipa opened this issue Sep 4, 2021 · 0 comments
Open
Labels

Comments

@ollipa
Copy link
Member

ollipa commented Sep 4, 2021

This code should pass:

def test_spy_class_method_with_args_on_derived_class_after_spying_base_class():
    flexmock(SomeClass).should_call("class_method_with_args").with_args(1).and_return(1)
    assert SomeClass.class_method_with_args(1) == 1
    flexmock(DerivedClass).should_call("class_method_with_args").with_args(2).and_return(2)
    assert DerivedClass().class_method_with_args(2) == 2
    assert DerivedClass.class_method_with_args(2) == 2

But it raises:

E       flexmock.exceptions.MethodSignatureError: Arguments for call class_method_with_args did not match expectations:
E         Received call:        class_method_with_args(2)
E         Expected call[1]:     class_method_with_args(1)
@ollipa ollipa added the bug label Sep 4, 2021
@ollipa ollipa changed the title Spying child class does not work after spying the base class Spying child class with_args does not work after spying the base class Sep 4, 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