Use pytest fixtures to reduce duplicated code across unit tests

InstructorWill Button

Share this video with your friends

Send Tweet

In this lesson, you will learn how to implement pytest fixtures. Many unit tests have the same resource requirements. For example, an instantiated object from a class. You will learn how to create the instance of the class one time as a fixture and reuse that object across all your tests. This results in faster tests, eliminates duplicate code, and uses less resources when running your tests.