Python test with Pytest__python

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.