Assume we have the following code:
def second_func(a, b, c):
""" some other definition"""
return something
def first_func(x, y, z):
""" some definition"""
d = second_func(a, b, c)
""" some definition"""
return something
and we are trying to write a test for first_func
. As you can see first_func
calls second_func
with some arguments a, b, c
that are generated inside its definition.
Is there any way to test what the return value of second_func
call inside first_func
would be? (in other words what d
would be?)
It's just a simple form of a very bigger question. I'm testing my telegram bot with telethon user and I need to test some return value of some functions that is used due to sending message with bot.
That is I can not change return value or even definition of functions and I was hoping somehow (by wrapping or patching those functions) I could see what they returned inside my e2e test.