- Pytest Tutorial
- Pytest - Home
- Pytest - Introduction
- Pytest - Environment Setup
- Identifying Test files and Functions
- Pytest - Starting With Basic Test
- Pytest - File Execution
- Execute a Subset of Test Suite
- Substring Matching of Test Names
- Pytest - Grouping the Tests
- Pytest - Fixtures
- Pytest - Conftest.py
- Pytest - Parameterizing Tests
- Pytest - Xfail/Skip Tests
- Stop Test Suite after N Test Failures
- Pytest - Run Tests in Parallel
- Test Execution Results in XML
- Pytest - Summary
- Pytest - Conclusion
- Pytest useful Resources
- Pytest - Quick Guide
- Pytest - Useful Resources
- Pytest - Discussion
Pytest - Summary
In this pytest tutorial, we covered the following areas −
- Installing pytest..
- Identifying test files and test functions.
- Executing all test files using pytest –v.
- Executing specific file usimng pytest <filename> -v.
- Execute tests by substring matching pytest -k <substring> -v.
- Execute tests based on markers pytest -m <marker_name> -v.
- Creating fixtures using @pytest.fixture.
- conftest.py allows accessing fixtures from multiple files.
- Parametrizing tests using @pytest.mark.parametrize.
- Xfailing tests using @pytest.mark.xfail.
- Skipping tests using @pytest.mark.skip.
- Stop test execution on n failures using pytest --maxfail = <num>.
- Running tests in parallel using pytest -n <num>.
- Generating results xml using pytest -v --junitxml = "result.xml".
Advertisements