...
Code Block |
---|
pip install -U pytest |
xxdxd
Other frameworks for testing Python code:
- Robot - https://robotframework.org/
- Unittest - https://docs.python.org/3/library/unittest.html
- DocTest - https://docs.python.org/3/library/doctest.html
- Nose2 - https://docs.nose2.io/en/latest/
ProsPros:
- Supports unittest.
- Open-source.
- Well-written documentation.
- Allows writing simple and compact test suits.
- Allows test parametrization.
- Test written using Pytest are extensible, there are many plugins available.
- Provides fixtures.
- Capable of executing multiple test cases simultaneously.
- Capable of skipping selected test methods from a group of methods during execution.
- Allows generating HTML test results.
...
- Because of Pytest’s unique syntax, you won’t be able to use tests written in Pytest in the different frameworks.
...
- frameworks
...
- .
Official Pytest documentation: https://docs.pytest.org/en/6.2.x/contents.html