pytest-tricks icon indicating copy to clipboard operation
pytest-tricks copied to clipboard

Markers in parametrized tests

Open hackebrot opened this issue 9 years ago • 2 comments
trafficstars

hackebrot avatar Feb 17 '16 01:02 hackebrot

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

danielhao5 avatar May 17 '20 14:05 danielhao5

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!

hackebrot avatar Sep 16 '21 08:09 hackebrot