Introduce the mature Pytest automated testing framework

Although we can use scripts to write automated testing frameworks, there is no need to repeatedly look for wheels, just introduce mature automated testing frameworks ,

Pytest is currently one of the most mature and comprehensive Python testing frameworks . It is simple, flexible, and easy to use. It is fully compatible with other testing frameworks such as unitest, supports parameterization and test orchestration, and has strong scalability.

1. Install Pytest

The command line cmd executes the command: pip install pytest

2. When using Pytest to write scripts, you must abide by the rules, otherwise the scripts cannot run normally

①The test file name must start with test_ or end with _test, such as test_1.py

②The name of the test class must start with Test and cannot have the __init__ method

③The name of the test function starts with test_

④ assert using the basic "assert{expression}"

Create a test_1.py file as an example.

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:

insert image description here

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

These materials should be the most comprehensive and complete preparation warehouse for [software testing] friends. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. I hope it can help you too!     

Guess you like

Origin blog.csdn.net/nhb687095/article/details/132427661