pytest-tricks
pytest-tricks copied to clipboard
Markers in parametrized tests
trafficstars
Hi,
Thanks for the great tips. What if I have a decimal_to_base(num, base) function that will take 2 parameters as input and I like to test multiple numbers. Examples:
decimal_to_base(10, 2) 1010 decimal_to_base(5, 2) 101
decimal_to_base(10, 8) 12
Can you show some examples? Thanks.
Daniel
Hi @danielhao5! 👋🏻
There's an example for using mark.parametrize with multiple values in the beginning of my blog post at https://raphael.codes/blog/create-parametrized-tests-with-pytest/.
Hope that helps!