Skip to content

augustogoulart/awesome-pytest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Awesome pytest Awesome

Contents

Videos

Michael Tom-Wing, Christie Wilson - Introduction to Unit Testing in Python with Pytest - PyCon 2016

Why I use py.test and maybe you should too

Python Code Review: Adding Pytest Tests to an Existing Python Web Scraper

Holger Krekel - pytest - rapid and simple testing with Python

Articles

Effective Python Testing With Pytest

Python unit testing with Pytest and Mock

The Cleaning Hand of Pytest

Django Test Driven Development with Pytest

Python Unit Testing(Pytest)

Creating a PySpark project with pytest, pyenv, and egg files

Unit testing Apache Spark with py.test

Testing sys.exit() with pytest

Passing fixtures to tests in pytest

Django + Mongo = Pytest FTW! A clean way to manage connecting and dropping of database between tests

Pytest-mock. How to mock your database connection

How to use pytest fixtures in Django testing

Testing Python Applications with Pytest

Pytest-Tricks

How to modularize your py.test fixtures

How to write parametrized tests using pytest

A checklist of best practices to speed up your pytest suite

Presentations

Adopt-a-pytest - slides

pytest for unittest users

Introduction to pytest - Andreas Pelme - Euro Python 2014

Pytest recommendations and basic packages for testing in Python and Django - Andreu Vallbona - PyBCN June 2019

Code samples and projects

Requests - Python HTTP Requests for Humans™ and Pytest

Plugins

Plugin List - PyPI projects that match “pytest-*” are considered plugins and are listed automatically. Packages classified as inactive are excluded. This list contains 865 plugins.

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 - Provides a fake file system that mocks the Python file system modules.

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 - A pytest plugin that allows multiple failures per test.

pytest-checkipdb - Plugin to check if there are ipdb/pdb/breakpoint breakpoints left into our code

pytest-clarity - A plugin to improve the readability of pytest output.

pytest-codeblocks - Tests code blocks in your READMEs.

pytest-cov - This plugin produces coverage reports

pytest-datadir - pytest plugin for manipulating test data directories and files

pytest-deadfixtures - A simple plugin to list unused or duplicated fixtures in a pytest suite.

pytest-embrace - Dataclasses-as-tests. Describe the runtime once and multiply coverage with no boilerplate.

pytest-django - pytest-django is a plugin for pytest that provides a set of useful tools for testing Django applications and projects.

pytest django-migrations-ci - pytest plugin to speed up test migrations with django-migrations-ci.

pytest-docfiles - Test the code sections in your documentation.

pytest-duration-insights - Gives an interactive dashboard to show where the slow tests are.

pytest-fast-first - Run fast tests before slower one.

pytest-flake8 - pytest plugin for efficiently checking PEP8 compliance

pytest-freezegun - Plugin that allows your Python tests to travel through time by mocking the datetime module.

pytest-git-selector - A pytest plugin to deselect tests that are not affected by code changes.

pytest-lazy-fixtures - Use your fixtures in @pytest.mark.parametrize.

pytest-memray - A plugin for easy integration of the memray memory profiler.

pytest-mimesis - Mimesis integration with the pytest test runner. Generate fake data in your tests.

pytest-modified-env - Pytest plugin to fail a test if it leaves modified os.environ afterwards.

pytest-monitor - Pytest-monitor is a pytest plugin designed for analyzing resource usage.

pytest-opentelemetry - Instruments your pytest runs, exporting the spans and timing via OpenTelemetry.

pytest-picked - Run tests related to changes detected by version control (e.g. run all tests in test files with unstaged changes).

pytest-pointers - Show the number of tests covering your code.

pytest-pyodide - Pytest plugin for testing applications that use Pyodide.

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 - A plugin for pytest that makes it easy to repeat a single test, or multiple tests, a specific number of times.

pytest-reportlog - Report logs into a file as the test session executes.

pytest-reverse - Pytest plugin to reverse test order.

pytest-robotframework - Lets you run both python and robotframework tests with pytest while generating robot reports for them.

pytest-ruff - Pytest plugin to lint code with ruff.

pytest-skipuntil - A simple pytest plugin to skip flapping test with deadline.

pytest-socket - Plugin to disable socket calls during tests.

pytest-spec - pytest plugin to display test execution output like a SPECIFICATION.

pytest-sugar - pytest-sugar changes the look and feel of pytest by adding a progressbar and instafailing tests.

pytest-testmon - Selects tests affected by changed files. Continous test runner when used with pytest-watch.

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 - Lets you create configuration profiles for pytest.

pytest-profiling - Profiling plugin for pytest, with tabular and heat graph output.

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 - Test collection content, ignoring order.

pytest-watch - Watches files and runs tests whenever a file is changed.

pytest-watcher - Automatically rerun your tests on file modifications

pytest-xdist - pytest plugin for distributed testing and loop-on-failures testing modes.

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

Calmcode - Intro to Testing with Pytest

Books

Python Testing with pytest by Brian Okken - The Pragmatic Programmers (publisher)

pytest Quick Start Guide by Bruno Oliveira - Packt (publisher)