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 the request.param.
Ready to Master Network Automation? Start Your Journey Today!
Our membership provides:
  • Full deep-dive course library (inc. Batfish, pyATS, Netmiko)
  • Code repositories inc. full course code, scripts and examples
  • 24x7 multi-vendor labs (Arista, Cisco, Juniper)
  • Private online community
  • Live monthly tech sessions
  • Access to tech session library

Join Now ➜
Close You've successfully subscribed to Packet Coders.
Close Success! Your account is fully activated, you now have access to all content.
Close Welcome back! You've successfully signed in.
Close Nearly there! To activate your account, please click the link in the email we just sent you.