Why pytest?
pytest is a software testing framework, which means pytest is a command-line tool that automatically finds tests you’ve written, runs the tests, and reports the results. It has a library of goodies that you can use in your tests to help you test more effectively. It can be extended by writing plugins or installing third-party plugins. And it integrates easily with other tools like continuous integration and web automation.
Here are a few of the reasons pytest stands out above many other testing frameworks:
-
Simple tests are simple to write in pytest.
-
Complex tests are still simple to write.
-
Tests are easy to read.
-
Tests are easy to read. (So important it’s listed twice.)
-
You can get started in seconds.
-
You use assert in tests for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access