Robots Atlas>ROBOTS ATLAS

Python — From Basics to Advanced · Testing with pytest

Fixtures

Testing with pytest

Introduction

A fixture is a function marked with @pytest.fixture that builds resources for tests (a database, objects, data). A test declares it needs a fixture by accepting it as an argument. scope, yield-style teardown, and conftest.py are the pillars of real-world usage.