June 2019
Beginner to intermediate
770 pages
19h 24m
English
The test setup and teardown features of pytest are often handled by @fixture functions. These functions form the fixture into which a unit is connected for testing. In the realm of hardware testing, it might also be called a test harness or test bench.
Fixtures can be used to do any kind of setup or teardown related to a test. Because of the way pytest invokes a test, it implicitly calls the fixture functions, simplifying our test code considerably. The fixtures can reference other fixtures, letting us create composite objects that can help to isolate the unit being tested.
Previously, we looked at two complex test case subclasses: TestDeckBuild and TestDeckDeal. These two test cases covered separate features ...
Read now
Unlock full access