This lesson is part of the Network Testing with Pytest course.
In this lesson, you will learn:
- What is fixture parametrization?
- How to refactor our Scrapli example to use fixture based parametrization.
You can find the scripts and code for this lesson within the Pytest repo under the directory: 004_parametrization/003_fixture_parametrization.
What is Fixture Parametrization?
In addition to parametrizing our tests we can also parametrize fixtures. This is useful if we want to add multiple parameters to a fixtures setup or teardown.
To parametrize a fixture we:
- provide the required params to the fixture decorator
- supply
request
to the fixture return
therequest.param
.