Python Forum

Full Version: Testing function calls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

Does someone know a nice library to test function calls? I am looking for something more expressive than the unittest module provides.

I'd like to do things like (in pytest notation)
assert func.called.times(2).with('foo')
or
assert func.called(nth=1).with('bar'))
. I confess that I'm influnced by JS libraries like jasmine and even mockery in PHP.
you can see if anything here: https://pypi.org/search/?q=testing
is suitable.