How do I run a test with pytest?
Pytest provides several options for running and selecting tests from the command line.
- Execute tests within a module. python test mod.py
- Execute tests in a directory. pytest testing/
- Use keyword expressions to run tests. pytest -k “MyClass and not method”
- Execute tests based on marker expressions. pytest -m slow
- Execute tests from packages.
However, if you are beginner, you can refer to this Selenium pytest tutorial.