how can i verify that a python method called with parameters includes data frames?

So I did some more digging and came across call_args which captures all of the parameters that were passed.

Even more useful for me was call_args_list as my method can be called multiple times.

The call_args_list provides a lit of all the calls that were made in the form of tuples.

In my example I captured the call_args_list with the following:

call_list = ClassToMock.method_to_mock.call_args_list

I then unpacked the tuples to get the DataFrame and was able to check equality with the .equals() method.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top