Welcome!
This repository contains all the source code used throughout my Pytest learning series. The goal of this repository is not just to show the final code but to help understand why each concept exists and how it is used in real projects.
Whether you're just getting started with Pytest or looking to strengthen your automation testing skills, you can use these examples to learn, practice, and experiment.
This repository covers the core concepts of Pytest step by step.
- Return Fixture
- Yield Fixture
- Fixture Chaining
- Parameterized Fixture
- Scoped Fixture
- Autouse Fixture
- Factory Fixture
- Sharing Fixtures using
conftest.py
- Writing Test Cases
- Assertions
- Test Discovery
- Running Tests
- Naming Conventions
- Markers
- Parametrize
- Hooks
- Custom Command Line Options
- Logging
- HTML Reports
- Screenshots
- Page Object Model (POM)
- Selenium Integration
- Data-Driven Testing
- Faker
- Parallel Execution
- CI/CD Integration
- Best Practices
- Production-Ready Framework
.
├── fixtures/
├── basics/
├── hooks/
├── reports/
├── pom/
├── utils/
├── test_data/
├── screenshots/
├── conftest.py
├── requirements.txt
└── README.md
The repository will continue to grow as new videos are published.
Before running the examples, make sure you have:
- Python 3.10 or later
- Pytest installed
- A code editor such as VS Code
Clone the repository:
git clone https://github.com/beinghumantester/Pytest_Automation_Tutorial.gitMove into the project directory:
cd https://github.com/beinghumantester/Pytest_Automation_Tutorial.gitInstall the required dependencies:
pip install -r requirements.txtRun all tests:
pytestRun tests with verbose output:
pytest -vRun tests and display print statements:
pytest -sRun tests with both verbose output and print statements:
pytest -s -vRun a specific file:
pytest test_file.pyRun a specific test:
pytest test_file.py::test_nameThis repository is useful for:
- Beginners learning Pytest
- Manual Testers moving into Automation
- QA Engineers
- SDETs
- Anyone preparing for automation testing interviews
Every example in this repository follows the same pattern:
- Understand the problem.
- Learn the Pytest feature.
- Write the code.
- Execute the test.
- Understand the output.
- Connect the concept to real-world automation frameworks.
The focus is on understanding the concepts rather than memorizing syntax.
If you find an issue, have suggestions, or want to improve an example, feel free to open an issue or submit a pull request.
Constructive feedback is always welcome.
If these examples help you learn something new, consider connecting with me.
- LinkedIn: (Linkedin profile link)
- YouTube: (Youtube channel link)
- GitHub: (GitHub profile)
Keep Learning and Keep Growing!