Files
developer-roadmap/roadmaps/python/content/pytest@3FDwJpesfelEyJrNWtm0V.md

10 lines
991 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# pytest
pytest is a popular, full-featured testing framework for Python. Tests are plain functions whose names start with `test_`, placed in files named `test_*.py` or `*_test.py`, and they use Python's built-in `assert` statement; when an assertion fails, pytest shows a detailed explanation of the values involved. Fixtures provide reusable setup and teardown that are injected into tests by name, `@pytest.mark.parametrize` runs the same test with different inputs, and a large plugin ecosystem adds features such as coverage reporting and parallel test runs. pytest can also run existing `unittest`-style tests.
Visit the following resources to learn more:
- [@official@Pytest Docs](https://docs.pytest.org/)
- [@article@Pytest Tutorial](https://www.tutorialspoint.com/pytest/index.htm)
- [@article@Effective Python Testing With Pytest](https://realpython.com/pytest-python-testing/)
- [@video@Pytest Tutorial – How to Test Python Code](https://www.youtube.com/watch?v=cHYq1MRoyI0)