Skip to content
Advertisement

Testing the same function with different parameters

I am trying to test a function multiple times using different parameters. The return value should be True.

JavaScript

What’s the best way to go about doing this in pytest? I want to avoid multiple functions acting as assert True wrappers e.g

JavaScript

Advertisement

Answer

Use @pytest.mark.parametrize()

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement