Python Test

87: Paths to Parametrization - from one test to many

09.11.2019 - By Brian OkkenPlay

Download our free app to listen on your phone

Download on the App StoreGet it on Google Play

There's a cool feature of pytest called parametrization.

It's totally one of the superpowers of pytest.

It's actually a handful of features, and there are a few ways to approach it.

Parametrization is the ability to take one test, and send lots of different input datasets into the code under test, and maybe even have different output checks, all within the same test that you developed in the simple test case.

Super powerful, but something since there's a few approaches to it, a tad tricky to get the hang of. Sponsored By:PyCharm Professional: Try PyCharm Pro with a 4 month free trial. Promo Code: TESTANDCODE22Links:git branch — -a : list all branches, -r : just remotespytest changelogpytest deprecations and removalsPython Testing with pytest — Test function parametrization is in chapter 2. Fixture parametrization is in chapter 3.Parametrizing test functions — pytest documentationpytest fixtures — pytest documentation

More episodes from Python Test