February 2022
Intermediate to advanced
274 pages
6h 28m
English
Plugins are code that needs to be tested just like any other code. However, testing a change to a testing tool is a little tricky. When we tested the plugin manually with test_slow.py, we
We’re going to automate those tests with the help of a plugin called pytester. pytester ships with pytest but is disabled by default. The first thing we need to do then, is to enable it in conftest.py:
| | pytest_plugins = ["pytester"] |
Now we can use pytester to write our test cases. pytester creates a temporary directory ...