December 2018
Intermediate to advanced
500 pages
12h 33m
English
Test fixtures provide a fixed baseline to enable us to reliably and repeatedly execute tests. Pytest makes it easy to declare a test fixture function by marking a function with the @pytest.fixture decorator. Then, whenever we use the fixture function name as an argument in a test function declaration, pytest will make the fixture function provide the fixture object. Now we will create the following two pytest fixture functions, which we will use in future test functions: