- #1
- 962
- 667
- TL;DR Summary
- Finding object and method names from the elements of some_mock.method_calls when using unittest.mock
Let's say that
How can I extract the names 'thing', 'pop', 'bob', 'smash' etc. from this array?
my_mock.method_calls
gives me this array:
Code:
[call.thing.pop(3, 4), call.thing.bob.smash(6, 7), call.thing.jig.slurp(4)]
How can I extract the names 'thing', 'pop', 'bob', 'smash' etc. from this array?