You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Pytest is a framework for testing Python code. Due to easy use, well-written documentation, and open-source It’s the most widely-used Python testing framework. To use Pytest you need to install it using pip. 

pip install -U pytest


Pros:

  • 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.

Cons:

  • Because of Pytest’s unique syntax, you won’t be able to use tests written in Pytest in the different frameworks.




Official documentation: https://docs.pytest.org/en/6.2.x/contents.html

  • No labels