0

I'm trying to patch one class with another one in tests, doing:

@patch('integrations.Client', 'tests.utils.MockClient')
def test_client(self):
    check_client()

method:

check_client()

is using __integrations.Client__ class, but unfortunately after doing @patch inside __check_client__ class is not replaced with __tests.utils.MockClient__

1 Answer 1

1

I just had to use patch with spec=True

@patch(...., spec=True)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.