Previously used pytest, found no systematic tutorials, official documents are in English, now try to partially translate a 17 published tutorial
The title "Python Test with Pytest"
Author Brian Okken
Directory
1. Preface
What is Pytest
Learn about pytest with test samples
The organizational structure of the book
You need to know.
Sample code and online resources
Preface: Slightly
What is Pytest
A robust Python testing tool, pytest can be used for any type and degree of software testing that can be used by development teams, QA teams, and open source projects. In fact, popular Web projects have been converted from unittest or nose to pytest, including Mozilla and Dropbox. Why. Because Pytest provides powerful features such as ' Asset ' rewrite, a Third-party plug-in module, a powerful and simple fixture module (which is not available in other test frameworks)
Pytest is a software testing framework that automatically discovers running test cases and generating test results from the command line. It has a lot of features that make your tests more efficient. You can extend it by writing a plugin or by installing a Third-party plug-in.
Here are some reasons why pytest is better than other test frameworks:
1, easy to write, easy to read
2, a few seconds to start
3. You can make a case fail by self.asserequal () or Self.assertlessthan ()
4, can run UnitTest or nose written test cases through Pytest
Pytest is now being developed and maintained by an active and growing company. It is so scalable and flexible that it can be easily integrated into your workflow. Because it's installed independent of your Python version, you can use the python2.6 and above and python3.3 and above