pytest-django
A Django plugin for pytest.
Install
pytest-django on PyPI
pip
pip install pytest-djangouv
uv add pytest-djangopoetry
poetry add pytest-djangoPackage facts
| License | pytest-django is released under the BSD (3-clause) license ---------------------------------------------------------- Copyright (c) 2015-2018, pytest-django authors (see AUTHORS file) All rights… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pytest |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Popularity | one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-13) |
Evidence: pytest_django-4.14.0-py3-none-any.whl
About pytest-django
from the package's own PyPI description — quoted content, verbatim
.. image:: https://img.shields.io/pypi/v/pytest-django.svg?style=flat :alt: PyPI Version :target: https://pypi.python.org/pypi/pytest-django
.. image:: https://img.shields.io/pypi/pyversions/pytest-django.svg :alt: Supported Python versions :target: https://pypi.python.org/pypi/pytest-django
.. image:: https://github.com/pytest-dev/pytest-django/workflows/main/badge.svg :alt: Build Status :target: https://github.com/pytest-dev/pytest-django/actions
.. image:: https://img.shields.io/pypi/djversions/pytest-django.svg :alt: Supported Django versions :target: https://pypi.org/project/pytest-django/
.. image:: https://img.shields.io/codecov/c/github/pytest-dev/pytest-django.svg?style=flat :alt: Coverage :target: https://codecov.io/gh/pytest-dev/pytest-django
Welcome to pytest-django!
pytest-django allows you to test your Django project/applications with the
pytest testing tool <https://pytest.org/>_.
Quick start / tutorial <https://pytest-django.readthedocs.io/en/latest/tutorial.html>_Changelog <https://pytest-django.readthedocs.io/en/latest/changelog.html>_- Full documentation:...
AI interpretation — verify before relying
AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page
pytest-django integrates Django with pytest, allowing you to write and run Django tests using pytest's fixtures, plugins, and streamlined syntax instead of Django's built-in test runner.
Low install friction with a single runtime dependency on pytest. Active maintenance: released 3 days ago with 1543 GitHub stars and continuous CI/CD signals.
BSD 3-clause permissive license allows commercial and private use with minimal restrictions; attribution and liability disclaimers apply.
Usage
pip install pytest-django
# In conftest.py or test file:
import pytest
@pytest.fixture
def example(db):
pass
def test_example(example):
assert True
Requires Python >=3.10 (CPython or PyPy); pytest >=7.0; Django 5.2, 6.0, or later. Django settings module must be configured via pytest.ini or DJANGO_SETTINGS_MODULE environment variable.
Verdict: pytest-django is a mature, actively maintained plugin (1543 stars, released 3 days ago) with permissive BSD licensing and low install friction. It bridges Django and pytest cleanly with a single dependency. No known vulnerabilities. Suitable for teams wanting pytest's fixture model and plugin ecosystem for Django testing.
Needs verification
- Whether database transaction handling and test isolation behavior matches Django's default test runner in all scenarios
- Performance characteristics compared to Django's manage.py test for large test suites
Similar packages
permissive · top 1,000 on PyPI
pytestpermissive · top 100 on PyPI
pytest-htmlcopyleft · top 1,000 on PyPI
pytest-runnerpermissive · top 1,000 on PyPI
pytest-metadatacopyleft · top 1,000 on PyPI
pytest-xdistpermissive · top 1,000 on PyPI
pytest-asynciopermissive · top 1,000 on PyPI
pluggypermissive · top 100 on PyPI
pytest-covpermissive · top 1,000 on PyPI
factory-boypermissive · top 1,000 on PyPI