Setting up test cases for code that manage data can be challenging but it’s an important skill to reliably test your code. You might have heard of the setup and teardown methods in unittest. In pytest you use fixtures and as you will discover in this article they are actually not that hard to set up. Fixtures have been labelled pytest’s killer feature so let’s explore them in this article using a practical example.
Articles on pytest-cov
Code Challenge 39 – Writing Tests With Pytest
By PyBites Team on 5 October 2017
Hi Pythonistas, let’s add some more challenges for October. Following our Python testing with pytest book review we let you write some tests with this awesome framework.