I’ve made a few changes to the pytest-expect fixture plugin.
- I’ve put the plugin code on github, https://github.com/okken/pytest-expect.
- It is re-arranged to be a plugin installable with pip. Although I don’t have it in pypi yet.
- I’ve modified the code to use pytest 2.7.0 @pytest.mark.hookwrapper.
- I incorporated Bruno’s feedback from the last post to allow both assert failures and expect failures to be reported in the same test.
- There’s a tests directory to test the plugin.
There’s still lots to do. But this is a decent start.
Instead of listing any code here, go check out the pytest-expect repository on github
Also, I’ve set up a pytest-expect page. Not much there yet, but I plan on hosting the documentation for this thing there.
Previous posts in this series:
- Delayed assert / multiple failures per test
- pytest delayed assert / multiple failure plugin, iteration 1
- pytest expect fixture plugin, iteration 1
Learn pytest fast!
- Get started using pytest today with the Hello, pytest! course.
- Or become the local pytest expert with The Complete pytest Course.
- Courses not your thing? Grab the book! Python Testing with pytest, 2nd edition.