So let's say I have a file like:
#foo.py
def bar_one(a):
return a + 1
def bar_two(a):
return a + 2
...
def bar_n(a):
return a + n
but I want to test this by check that the return type of all the functions are of type int.
So what I would like to do is somthing like this:
# test_foo.py
import foo
def test_foo():
for func in foo:
assert isinstance(func(1), int)
is there a way of doing