$npx skillfedfor your agent

pytest-django

A Django plugin for pytest.

Worth itPyPI TestingReleased Aug 202621.6M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pytest_django-4.14.0-py3-none-any.whl
v4.14.0 · released 2026-08-10 · Python >=3.10 · 1 runtime deps: pytest

Yes. pytest-django is actively maintained (release 4 days old), has no known vulnerabilities, low install friction, and is widely used (top 1000 PyPI packages by downloads). It's the standard way to run Django tests with pytest and is worth installing if your team prefers pytest's conventions and plugin ecosystem over Django's built-in test runner.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Django 5.2, 6.0, or latest main branch; Python 3.10+; pytest 7.0+.
  • Django settings module must be configured via DJANGO_SETTINGS_MODULE environment variable or pytest.ini.
  • Low friction: pure Python wheel, single runtime dependency (pytest), and actively maintained with a release 4 days old.

License · maintenance · safety

permissive license (permissive) — BSD 3-clause license (permissive): you can use, modify, and distribute pytest-django freely in commercial and private projects with minimal restrictions, provided you retain copyright notices.

last release 2026-08-10 (4 days) · last repo commit 2026-08-10 · 1,543 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 21,555,994 downloads/mo, #999 on PyPI

Verify before relying

pip install pytest-django

# In conftest.py or pytest.ini, configure Django settings
# pytest.ini: [pytest]
# DJANGO_SETTINGS_MODULE = myproject.settings

# Then write tests as regular functions:
# def test_user_creation(db):
#     User.objects.create(username='test')
#     assert User.objects.count() == 1
  • Whether database re-use across test runs (mentioned in description) applies to all database backends or only specific ones.
  • Performance improvement magnitude when using pytest-xdist for parallel test execution with Django.
  • Compatibility details with Django's async test features (if any).
Same gist for agents: .md · .json

What it is and what it does

pytest-django is a pytest plugin that bridges Django's test infrastructure with pytest's testing framework. Instead of using Django's manage.py test command, you write tests as regular functions and leverage pytest's fixture system, plugin ecosystem, and conventions. The plugin handles Django-specific setup like database transactions, test database creation, and settings configuration automatically.

It's designed for teams that prefer pytest's lighter syntax and richer plugin landscape over Django's unittest-based approach. The package maintains compatibility with Django 5.2, 6.0, and the latest development branch, supports both CPython 3.10+ and PyPy 3, and works alongside existing unittest-style TestCase classes without requiring changes to them.

Use it for

  • Write Django unit tests as simple functions with pytest fixtures instead of TestCase subclasses.
  • Reuse test database across multiple test runs to reduce setup overhead.
  • Integrate pytest plugins (like pytest-xdist for parallel execution) into your Django test suite.
  • Migrate an existing Django project from manage.py test to pytest incrementally.
  • Use pytest's parametrize and fixture dependency injection for cleaner, more maintainable Django tests.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

pytest-django is actively maintained (release 4 days old), has no known vulnerabilities, low install friction, and is widely used (top 1000 PyPI packages by downloads). It's the standard way to run Django tests with pytest and is worth installing if your team prefers pytest's conventions and plugin ecosystem over Django's built-in test runner.

Install

pytest-django on PyPI

Before you install

Low friction: pure Python wheel, single runtime dependency (pytest), and actively maintained with a release 4 days old. Repository shows 1543 stars and recent commits.

Requires Django 5.2, 6.0, or latest main branch; Python 3.10+; pytest 7.0+. Django settings module must be configured via DJANGO_SETTINGS_MODULE environment variable or pytest.ini.

License in practice

BSD 3-clause license (permissive): you can use, modify, and distribute pytest-django freely in commercial and private projects with minimal restrictions, provided you retain copyright notices.

Quickstart

pip install pytest-django

# In conftest.py or pytest.ini, configure Django settings
# pytest.ini: [pytest]
# DJANGO_SETTINGS_MODULE = myproject.settings

# Then write tests as regular functions:
# def test_user_creation(db):
#     User.objects.create(username='test')
#     assert User.objects.count() == 1

Verify before relying

  • Whether database re-use across test runs (mentioned in description) applies to all database backends or only specific ones.
  • Performance improvement magnitude when using pytest-xdist for parallel test execution with Django.
  • Compatibility details with Django's async test features (if any).

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
1 package
pytest
MaintenanceActively maintained 4 days since the last release
Last repo commit
First released
Downloads21,555,994 / month, #999 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Testing

Evidence: pytest_django-4.14.0-py3-none-any.whl

Tags

Capabilities
django testing with pytestpytest django integrationdjango test fixturespytest django plugindjango unit testing frameworkpytest django databaserun django tests pytest
Topics
djangotestingpytest-plugin

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “django testing with pytest”

  • pytest-djangopytest-django integrates Django with pytest, letting you write and…
  • django-test-plusProvides a TestCase subclass for Django with helper methods to reduce…
  • django-test-migrationsTests Django schema and data migrations, including forward/backward…

Give your agent the search over MCP, or paste the wish link into any chat.

More Testing packages

pluggy Worth it
PyPI · Libraries · released May 2025

Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.

Install it if you're building an extensible application or framework.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo
virtualenv Worth it
PyPI · Libraries · released Aug 2026

virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.

MITpure Python · 3.9+
532.9Mdownloads / mo
coverage Worth it
PyPI · Testing · released Aug 2026

Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.

Install it if you want to measure test completeness or enforce coverage thresholds in your project.

permissive licensepure Python · 3.10+
335.8Mdownloads / mo
pytest-asyncio Worth it
PyPI · Testing · released May 2026

pytest-asyncio is a pytest plugin that enables writing and running async test functions using the asyncio library, allowing developers to await code directly within test cases.

Install it if you write tests for any asyncio-based code.

Apache-2.0pure Python · 3.10+
275.9Mdownloads / mo
pytest-json-ctrf Worth it
PyPI · Testing · released Jul 2026

A pytest plugin that generates test reports in Common Test Report Format (CTRF) as JSON, compatible with pytest-xdist and pytest-playwright for distributed and browser-based testing.

Install it if you need CTRF-formatted test output for CI/CD integration or cross-tool reporting.

MITpure Python · 3.8+
273.0Mdownloads / mo

See also pytest-runner · django-webtest · pytest-selenium · django-test-plus · pytest-xprocess · pytest-base-url · pytest-faker · pytango · django-coverage-plugin