Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Testing function calls
#1
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.
Reply
#2
you can see if anything here: https://pypi.org/search/?q=testing
is suitable.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  asyncio calls within sync function ( Websocket on_open) orion67 0 129 Jan-16-2022, 11:00 AM
Last Post: orion67
  Calls to Attributes of a Class SKarimi 3 1,512 Apr-22-2021, 04:18 PM
Last Post: SKarimi
  list call problem in generator function using iteration and recursive calls postta 1 812 Oct-24-2020, 09:33 PM
Last Post: bowlofred
  RuntimeError: Optimal parameters not found: Number of calls to function has reached m bntayfur 0 3,773 Aug-05-2020, 04:41 PM
Last Post: bntayfur
  Need help with a function that calls other functions. skurrtboi 4 1,158 Sep-30-2019, 09:28 PM
Last Post: stullis
  How to split a string containing function calls? Metalman488 4 1,770 Oct-27-2018, 06:50 PM
Last Post: Metalman488
  function state between calls Skaperen 5 3,469 Feb-08-2018, 02:20 AM
Last Post: Skaperen
  Is there another way to do a bunch of methods calls ? Windspar 7 3,018 Jan-02-2018, 06:26 PM
Last Post: Windspar
  Function calls inside a Class kerzol81 2 2,426 Mar-05-2017, 06:45 PM
Last Post: kerzol81
  Tracing function calls PyRaider 1 2,761 Oct-25-2016, 03:44 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020