Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/augustogoulart/awesome-pytest

A curated list of awesome pytest resources
https://github.com/augustogoulart/awesome-pytest

List: awesome-pytest

awesome digitalocean hacktoberfest open-source pytest python testing

Last synced: 3 months ago
JSON representation

A curated list of awesome pytest resources

Lists

README

        

# Awesome pytest [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)



## Contents

- [Videos](#videos)
- [Articles](#articles)
- [Presentations](#presentations)
- [Code samples and projects](#code-samples-and-projects)
- [Plugins](#plugins)
- [Courses](#courses)
- [Books](#books)

## Videos

[Michael Tom-Wing, Christie Wilson - Introduction to Unit Testing in Python with Pytest - PyCon 2016](https://www.youtube.com/watch?v=UPanUFVFfzY)

[Why I use py.test and maybe you should too](https://www.youtube.com/watch?v=P-AhpukDIik)

[Python Code Review: Adding Pytest Tests to an Existing Python Web Scraper](https://www.youtube.com/watch?v=03Ki2WpVRBc)

[Holger Krekel - pytest - rapid and simple testing with Python](https://www.youtube.com/watch?v=9LVqBQcFmyw)

## Articles

[Effective Python Testing With Pytest](https://realpython.com/pytest-python-testing/)

[Python unit testing with Pytest and Mock](https://medium.com/@bfortuner/python-unit-testing-with-pytest-and-mock-197499c4623c)

[The Cleaning Hand of Pytest](https://blog.daftcode.pl/the-cleaning-hand-of-pytest-28f434f4b684)

[Django Test Driven Development with Pytest](https://medium.com/@Afroshok/django-test-driven-development-with-pytest-63cb99e6fff2)

[Python Unit Testing(Pytest)](https://medium.com/python-pandemonium/testing-sys-exit-with-pytest-10c6e5f7726f)

[Creating a PySpark project with pytest, pyenv, and egg files](https://medium.com/@mrpowers/creating-a-pyspark-project-with-pytest-pyenv-and-egg-files-d2709eb1604c)

[Unit testing Apache Spark with py.test](https://engblog.nextdoor.com/unit-testing-apache-spark-with-py-test-3b8970dc013b)

[Testing sys.exit() with pytest](https://medium.com/python-pandemonium/testing-sys-exit-with-pytest-10c6e5f7726f)

[Passing fixtures to tests in pytest](https://medium.com/python-pandemonium/passing-fixtures-to-test-in-pytest-e8dade1f01ff)

[Django + Mongo = Pytest FTW! A clean way to manage connecting and dropping of database between tests](https://medium.com/@antash/django-mongo-pytest-ftw-1610c99588ab)

[Pytest-mock. How to mock your database connection](https://medium.com/@mariusz.raczynski2/pytest-mock-how-to-mock-your-database-connection-5c84a5a0bfc3)

[How to use pytest fixtures in Django testing](https://medium.com/@harshvb7/how-to-use-pytest-fixtures-in-django-testing-44969f3f29e5)

[Testing Python Applications with Pytest](https://semaphoreci.com/community/tutorials/testing-python-applications-with-pytest)

[Pytest-Tricks](http://hackebrot.github.io/pytest-tricks/)

[How to modularize your py.test fixtures](https://gist.github.com/peterhurford/09f7dcda0ab04b95c026c60fa49c2a68)

[How to write parametrized tests using pytest](https://geniepy.com/blog/how-to-write-parametrized-tests-using-pytest/)

[A checklist of best practices to speed up your pytest suite](https://github.com/zupo/awesome-pytest-speedup)

## Presentations

[Adopt-a-pytest](https://www.youtube.com/watch?v=0BzXV0J3-v8) - [slides](https://speakerdeck.com/daneah/adopt-a-pytest)

[pytest for unittest users](https://gitpitch.com/nicoddemus/pytest-for-unittest-users)

[Introduction to pytest - Andreas Pelme - Euro Python 2014](https://www.youtube.com/watch?v=LdVJj65ikRY)

[Pytest recommendations and basic packages for testing in Python and Django - Andreu Vallbona - PyBCN June 2019](https://www.slideshare.net/AndreuVallbonaPlazas/pybcn-pytest-recomendaciones-paquetes-bsicos-para-testing-en-python-y-django)

## Code samples and projects

[Requests - Python HTTP Requests for Humans™ and Pytest](https://github.com/requests/requests/tree/master/tests)

## Plugins

[Plugin List](https://docs.pytest.org/en/latest/reference/plugin_list.html) - PyPI projects that match “pytest-*” are considered plugins and are listed automatically. Packages classified as inactive are excluded. This list contains 865 plugins.

[AFLuent](https://github.com/AFLuent/AFLuent) - Automated fault localization tool built as a Pytest plugin. It's triggered when one or more test case fails causing it to generate a ranking of suspicious statements where the cause of the fault could possibly be.

[pyfakefs](https://github.com/pytest-dev/pyfakefs) - Provides a fake file system that mocks the Python file system modules.

[pytest-bdd](https://pypi.python.org/pypi/pytest-bdd) - pytest-bdd implements a subset of the Gherkin language to enable automating project requirements testing and to facilitate behavioral driven development.

[pytest-check](https://github.com/okken/pytest-check) - A pytest plugin that allows multiple failures per test.

[pytest-checkipdb](https://pypi.org/project/pytest-checkipdb/) - Plugin to check if there are ipdb/pdb/breakpoint breakpoints left into our code

[pytest-clarity](https://github.com/darrenburns/pytest-clarity) - A plugin to improve the readability of pytest output.

[pytest-codeblocks](https://github.com/nschloe/pytest-codeblocks) - Tests code blocks in your READMEs.

[pytest-cov](https://pypi.org/project/pytest-cov/) - This plugin produces coverage reports

[pytest-datadir](https://github.com/gabrielcnr/pytest-datadir) - pytest plugin for manipulating test data directories and files

[pytest-deadfixtures](https://pypi.python.org/pypi/pytest-deadfixtures) - A simple plugin to list unused or duplicated fixtures in a pytest suite.

[pytest-embrace](https://github.com/ainsleymcgrath/pytest-embrace) - Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate.

[pytest-django](https://pytest-django.readthedocs.io/en/latest/) - pytest-django is a plugin for pytest that provides a set of useful tools for testing Django applications and projects.

[pytest django-migrations-ci](https://github.com/buserbrasil/django-migrations-ci) - pytest plugin to speed up test migrations with django-migrations-ci.

[pytest-docfiles](https://github.com/stefanhoelzl/pytest_docfiles) - Test the code sections in your documentation.

[pytest-duration-insights](https://github.com/koaning/pytest-duration-insights) - Gives an interactive dashboard to show where the slow tests are.

[pytest-fast-first](https://pypi.org/project/pytest-fast-first/) - Run fast tests before slower one.

[pytest-flake8](https://pypi.org/project/pytest-flake8/) - pytest plugin for efficiently checking PEP8 compliance

[pytest-freezegun](https://pypi.org/project/pytest-freezegun/) - Plugin that allows your Python tests to travel through time by mocking the datetime module.

[pytest-git-selector](https://github.com/05798/pytest-git-selector) - A pytest plugin to deselect tests that are not affected by code changes.

[pytest-lazy-fixtures](https://github.com/tvorog/pytest-lazy-fixture) - Use your fixtures in `@pytest.mark.parametrize`.

[pytest-memray](https://github.com/bloomberg/pytest-memray) - A plugin for easy integration of the [memray](https://github.com/bloomberg/memray) memory profiler.

[pytest-mimesis](https://github.com/pytest-dev/pytest-mimesis) - Mimesis integration with the pytest test runner. Generate fake data in your tests.

[pytest-modified-env](https://github.com/wemake-services/pytest-modified-env) - Pytest plugin to fail a test if it leaves modified `os.environ` afterwards.

[pytest-monitor](https://github.com/CFMTech/pytest-monitor) - Pytest-monitor is a pytest plugin designed for analyzing resource usage.

[pytest-opentelemetry](https://github.com/chrisguidry/pytest-opentelemetry) - Instruments your pytest runs, exporting the spans and timing via OpenTelemetry.

[pytest-picked](https://pypi.org/project/pytest-picked/) - Run tests related to changes detected by version control (e.g. run all tests in test files with unstaged changes).

[pytest-pointers](https://github.com/jaklimoff/pytest-pointers) - Show the number of tests covering your code.

[pytest-pyodide](https://github.com/pyodide/pytest-pyodide) - Pytest plugin for testing applications that use [Pyodide](https://pyodide.org/).

[pytest-randomly](https://github.com/pytest-dev/pytest-randomly) - Pytest plugin to randomly order tests and control `random.seed`. By randomly ordering the tests, the risk of surprising inter-test dependencies is reduced.

[pytest-repeat](https://github.com/pytest-dev/pytest-repeat) - A plugin for pytest that makes it easy to repeat a single test, or multiple tests, a specific number of times.

[pytest-reportlog](https://github.com/pytest-dev/pytest-reportlog) - Report logs into a file as the test session executes.

[pytest-reverse](https://github.com/adamchainz/pytest-reverse) - Pytest plugin to reverse test order.

[pytest-robotframework](https://github.com/detachhead/pytest-robotframework) - Lets you run both python and robotframework tests with pytest while generating robot reports for them.

[pytest-ruff](https://github.com/buserbrasil/pytest-ruff) - Pytest plugin to lint code with ruff.

[pytest-skipuntil](https://github.com/bp72/pytest-skipuntil) - A simple pytest plugin to skip flapping test with deadline.

[pytest-socket](https://github.com/miketheman/pytest-socket) - Plugin to disable socket calls during tests.

[pytest-spec](https://pypi.python.org/pypi/pytest-spec) - pytest plugin to display test execution output like a SPECIFICATION.

[pytest-sugar](https://pypi.org/project/pytest-sugar/) - pytest-sugar changes the look and feel of pytest by adding a progressbar and instafailing tests.

[pytest-testmon](https://github.com/tarpas/pytest-testmon) - Selects tests affected by changed files. Continous test runner when used with pytest-watch.

[pytest-pinned](https://github.com/freol35241/pytest-pinned) - A simple pytest plugin for writing pinning tests. Pinning tests, snapshot tests or characterization tests are meant to describe (characterize) the actual behavior of an existing piece of software, and therefore protect existing behavior against unintended changes via automated testing.

[pytest_profiles](https://github.com/stefanhoelzl/pytest_profiles) - Lets you create configuration profiles for pytest.

[pytest-profiling](https://github.com/man-group/pytest-plugins/tree/master/pytest-profiling) - Profiling plugin for pytest, with tabular and heat graph output.

[pytest-testinfra](https://github.com/pytest-dev/pytest-testinfra) - Infrastructure testing to validate the actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on.

[pytest-unordered](https://github.com/utapyngo/pytest-unordered) - Test collection content, ignoring order.

[pytest-watch](https://pypi.org/project/pytest-watch/) - Watches files and runs tests whenever a file is changed.

[pytest-watcher](https://github.com/olzhasar/pytest-watcher) - Automatically rerun your tests on file modifications

[pytest-xdist](https://github.com/pytest-dev/pytest-xdist) - pytest plugin for distributed testing and loop-on-failures testing modes.

[syrupy](https://github.com/tophat/syrupy) - The sweeter pytest snapshot plugin. It enables developers to write tests which assert immutability of computed results.

## Courses

[Test-Driven Development with Python, Flask, and Docker](https://testdriven.io/courses/tdd-flask/)

[Calmcode - Intro to Testing with Pytest](https://calmcode.io/pytest/introduction.html)

## Books

Python Testing with pytest by Brian Okken - [The Pragmatic Programmers (publisher)](https://pragprog.com/book/bopytest/python-testing-with-pytest)

pytest Quick Start Guide by Bruno Oliveira - [Packt (publisher)](https://www.packtpub.com/web-development/pytest-quick-start-guide)