Open wn opened 1 year ago
does any one know a way to do that?
I manage to have this working with this:
def setup(f: Callable):
def _f(self, some_arg: str):
self.some_function_from_my_test_class()
return f(self, some_arg)
_f.__name__ = f.__name__
_f.__annotations__ = f.__annotations__
_f.__docs__ = getattr(f, "__docs__", "")
return _f
for some reason it didn't work with functools.wraps, what would be much better
and I call it with:
class MyTestCase(TestCase):
@parameterized.expand(LIST_OF_INPUTS)
@setup
def test_my_func(self, some_arg: str) -> None:
...
I was wondering if its possible to inject decorators to expanded functions.
to become