Index
- Running tests
1.1 Run all tests
1.2 Run individual test modules
1.3 Run all tests inside a folder
1.4 Run a specific test inside a module
1. Running tests
In this tutorial we will see a bunch of possible ways you can run your tests using pytest.
1.1 Run all tests
pipenv run python -m pytest
1.2 Run individual test modules
pipenv run python -m pytest tests/test_search.py
1.3 Run all tests inside a folder
pipenv run python -m pytest tests/
1.4 Run a specific test inside a module
pipenv run python -m pytest tests/test_search.py::test_basic_duckduckgo_search
PS: Calling a test inside a module does not work when using pytest-bdd, for this case please use tags.
2. Repository
If you want to test the commands above, clone the project from the link below and run the commands in the project root.
https://github.com/LuizGustavoR/intro-selenium-py/tree/tutorial/webdriver-with-python
The end.
3. Thanks
- This guide was created based on the course “Behavior Driven Python with pytest-bdd” by Andrew Knight.
- Course available at “Testing Automation University”.