In this lesson, you will learn:
- How to share fixtures between our tests.
- How to refactor our Scrapli example to use shared fixtures.
Introduction to conftest.py
A question that you may now be asking is:
How can I share fixtures across multiple test files?
The answer is
conftest.py. By creating a file named
conftest.py, any fixtures that we place within it will then be shared across other fixtures and tests within our other files.
Let's look at an example.