September 2017
Intermediate to advanced
222 pages
5h 1m
English
In addition to the fixture model described in Chapter 3, pytest Fixtures, pytest also supports xUnit style fixtures, which are similar to jUnit for Java, cppUnit for C++, and so on.
Generally, xUnit frameworks use a flow of control that looks something like this:
| | setup() |
| | test_function() |
| | teardown() |
This is repeated for every test that will run. pytest fixtures can do anything you need this type of configuration for and more, but if you really want to have setup() and teardown() functions, pytest allows that, too, with some limitations.
Read now
Unlock full access