pytest-isort
py.test plugin to check import ordering using isort
Decision gist · record as of 2026-08-14
Yes, if you use pytest and want import-order enforcement as part of your test suite. The plugin is stable, has no known vulnerabilities, and integrates cleanly with isort. Maintenance is dormant but the package is mature and unlikely to need updates for basic functionality. Install it if your team values consistent import ordering; skip it if you prefer a separate linting tool or have no import-order standards.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python >=3.8,<4 and pytest>=5 as runtime dependencies.
- Low friction install with two straightforward runtime dependencies (pytest and isort).
- Maintenance is dormant—last release was 2024-03-05 and no commits since 2024-04-12—but the package is marked Production/Stable and carries no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2024-03-05 (892 days) · last repo commit 2024-04-12 · 40 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 101,768 downloads/mo, #12,917 on PyPI
Alternatives
Verify before relying
pip install pytest-isort
# Then in your test run:
py.test --isort
# Or configure in pytest.ini:
[pytest]
isort_ignore =
docs/conf.py- Whether the plugin's skip-on-unchanged-files optimization (mentioned in the description) remains reliable across pytest versions.
- Current compatibility with isort's latest major versions and any breaking changes to isort's API.
What it is and what it does
pytest-isort is a pytest plugin that integrates isort import-sorting checks into your test suite. When you run pytest with the --isort flag, it scans all Python files in your project and fails tests for any files with incorrectly ordered imports, showing a diff of what isort expects. You can exclude specific files or patterns via isort_ignore in your pytest configuration, and the plugin skips re-checking files that previously passed to speed up repeated test runs.
The plugin sits between pytest and isort, using isort as its sorting engine. It's useful for teams that want import-order enforcement as part of their CI/CD pipeline without requiring a separate linting step. Configuration is minimal—just add the --isort flag or set isort_ignore rules in pytest.ini—and it respects isort's own configuration files.
Use it for
- Enforce consistent import ordering in CI/CD pipelines by failing builds when imports are unsorted.
- Catch import-order violations during local test runs before code review, using pytest's existing test infrastructure.
- Exclude specific files or migration directories from import checks while validating the rest of the codebase.
- Speed up repeated test runs by skipping files that already passed isort checks in previous runs.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use pytest and want import-order enforcement as part of your test suite.
The plugin is stable, has no known vulnerabilities, and integrates cleanly with isort. Maintenance is dormant but the package is mature and unlikely to need updates for basic functionality. Install it if your team values consistent import ordering; skip it if you prefer a separate linting tool or have no import-order standards.
Install
pytest-isort on PyPI
Before you install
Low friction install with two straightforward runtime dependencies (pytest and isort). Maintenance is dormant—last release was 2024-03-05 and no commits since 2024-04-12—but the package is marked Production/Stable and carries no known vulnerabilities.
Requires Python >=3.8,<4 and pytest>=5 as runtime dependencies.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install pytest-isort
# Then in your test run:
py.test --isort
# Or configure in pytest.ini:
[pytest]
isort_ignore =
docs/conf.py
Verify before relying
- Whether the plugin's skip-on-unchanged-files optimization (mentioned in the description) remains reliable across pytest versions.
- Current compatibility with isort's latest major versions and any breaking changes to isort's API.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.8,<4 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespytestisort |
| Maintenance | Dormant 892 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 101,768 / month, #12,917 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Testing |
Evidence: pytest_isort-4.0.0-py3-none-any.whl
Tags
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 › “pytest import sorting checker”
- pytest-isortA pytest plugin that automatically checks whether imports in Python…
- usortμsort sorts Python imports within detected blocks while preserving…
- classify-importsParses, classifies, and sorts Python import statements into standard…
Give your agent the search over MCP, or paste the wish link into any chat.
More Testing packages
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.
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.
virtualenv creates isolated Python environments where packages can be installed independently without affecting the system Python or other projects.
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.
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.
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.
See also isort · pytest-timestamper · pytest-pep8 · flake8-isort · pytest-picked · pytest-ordering · usort · pytest-mypy-plugins · pytest-randomly · pytest-only