From 0 to 1, proficient in automated testing, pytest automated testing framework, configuration file pytest ini

1, Foreword The pytest configuration file can change the operation mode of pytest. It is a fixed file pytest INI file, read the configuration information and run it in the specified way 2, ini configuration file Some files in pytest are non test files pytest. Ini is the main configuration file of pytest, which can change the default be ...

Posted by orison316 on Mon, 07 Mar 2022 12:50:33 +0100

Pytest study notes - Skip and Xfail

skip and xfail preface In actual use, it is often necessary to skip some test cases. pytest provides skip and ifskip to skip the test skip Tag in test function Usage example: @ pytest mark. Skip (reason = "the reason for skipping will be printed in the execution result"), for example 🌰: import pytest def test_1(): print(" ...

Posted by iii on Fri, 11 Feb 2022 00:59:38 +0100

pytest document 63 - pytestconfig of built-in fixture

preface As mentioned earlier, request is a built-in fixture of pytest. It is used to obtain the test context through request Config gets the configuration object. The function of pytestconfig is the same as that of request Config is the same, which is to obtain the configuration object pytestconfig source code analysis pytestconfig is a buil ...

Posted by usacascl on Sun, 23 Jan 2022 23:24:51 +0100

Pytest document 43 - Metadata usage (pytest metadata)

preface What is metadata? Metadata is a description of data, which stores information about data and provides help for people to retrieve information more conveniently. The metadata in the pytest framework can be implemented using the pytest metadata plug-in. Document address https://pypi.org/project/pytest-metadata/ Pytest metadata environme ...

Posted by chauffeur on Sat, 22 Jan 2022 18:41:46 +0100

LateNight: where? I use the local environment pytest to take you to play custom operators

Late at night: where? I use the local environment pytest to take you to play custom operators module1: Multi play Python debugging framework pytest Beginner's introduction Hello everyone, the python general testing framework is unittest+HTMLTestRunner. I have seen the pytest document during this period and found that this framework and ric ...

Posted by jmarcv on Wed, 19 Jan 2022 03:10:03 +0100

Use of pytest framework fixture

catalogue fixture advantages Scope of fixture fixture source code details scope range of four parameters scope="function"  scope="class"  scope="module" scope="session" conftest.py 1. Disposition 2. Scope of action Three methods of calling fixture 1. The method in the function or class directly passes the name of the function param ...

Posted by BDKR on Sun, 16 Jan 2022 12:21:04 +0100

2 setup and teardown in the test script class

catalogue Class level setup and teardownMethod level setup and teardown in classsetup and teardown in class text Setup and teardown are very common preconfiguration and cleaning configurations in test scripts, that is, some preset processing before the execution of the use case and some cleaning configuration for environment recovery after t ...

Posted by sbourdon on Sun, 19 Dec 2021 19:30:49 +0100

Python test framework pytest (12) Hooks function - other Hooks functions

catalogue 1,pytest_report_teststatus custom test results 2,pytest_ generate_ Generate test cases parameterized by tests   3. More Hooks functions 1,pytest_report_teststatus custom test results pytest_ report_ The teststatus (report, config) hook function returns the result category, short letters and detailed words of the status repo ...

Posted by kodlcan on Fri, 22 Oct 2021 07:37:02 +0200

Pytest learn and use setup, teardown and other methods in 4-pytest and Unittest (the most complete)

1 Unittest two pre and two post methods When using Unittest framework and selenium to do Web UI automation test, we often encounter when to open and close the browser. At this time, we use two pre and post methods of Unittest;What are the four methods? See the table below: methodexplainsetup()Execute once before executing a use case. For ...

Posted by Adam W on Thu, 09 Sep 2021 20:22:29 +0200

Requests library for automated testing of Python interfaces & Pytest framework

preface: Thank you for reading uncle Qi's article. Thank you to all readers. If it's convenient, please move your hands to make a fortune and pay attention. Uncle Qi's article may not be so vivid and interesting, but I still hope it can bring you improvement. At the end of the article, some of Uncle Qi's dry goods are also the resources ...

Posted by habuchas on Fri, 03 Sep 2021 05:48:28 +0200