--- id: pytest-black version: "0.6.0" license: MIT license_treatment: permissive maintenance: dormant --- # pytest-black — A pytest plugin to enable format checking with black License: permissive · Maintenance: dormant · Downloads: 157.2K/mo ## What it is and what it does pytest-black is a pytest plugin that integrates black's code formatting checks into your test suite. When you run pytest with the --black flag, it scans your code and reports any formatting violations that black would fix, displaying a diff of suggested changes. The plugin does not modify your code—it only reports violations, leaving the decision to apply changes to you or your CI pipeline. The plugin relies on pytest, black, and toml as runtime dependencies. It reads black configuration from pyproject.toml if present, allowing you to customize formatting rules per project. This makes it useful for enforcing consistent code style as part of automated testing rather than as a standalone formatter. Use it for: - Enforce code formatting standards in CI/CD pipelines by failing tests when black violations are detected. - Catch formatting inconsistencies during local development before pushing code to version control. - Integrate style checking into existing pytest workflows without adding separate linting steps. - Report formatting diffs to developers during test runs so they can see exactly what black would change. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that runs black format checks on your code during test execution, reporting formatting violations without applying changes automatically. Yes, if you already use pytest and black and want formatting checks as part of your test suite. The low install friction and permissive license make it straightforward to add. However, the dormant maintenance status (last commit 2024-12-23, zero repository stars) and old Python support floor (>=3.5) suggest limited ongoing development; verify compatibility with your current black version before relying on it in production CI/CD. ## Install pip install pytest-black uv add pytest-black poetry add pytest-black ## Installing pytest-black Before you install: Low friction install with three straightforward dependencies (pytest, black, toml). Maintenance is dormant—last release was 2024-12-15 but no commits since 2024-12-23, and the repository shows zero stars, suggesting limited active community engagement. License in practice: MIT license (permissive) means you can use, modify, and distribute the package freely with minimal restrictions, typical for open-source development tools. Quickstart: pip install pytest-black # In your test run: pytest --black # Outputs formatting diffs without applying changes Requires black 19.3b0 or later; requires pytest and toml as runtime dependencies. Verify before relying: - Whether the plugin works correctly with recent black versions beyond 19.3b0. - Current state of compatibility with modern Python 3.x versions (requires_python is >=3.5, which is quite old). - Whether dormant maintenance status affects reliability in active CI/CD pipelines. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 157.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest black format checking, code style validation pytest, black integration testing, format linting in tests, pytest formatting plugin, pytest-plugin, code-formatting, ci-integration [View on SkillFed](https://skillfed.io/packages/pytest-black) · [View on PyPI](https://pypi.org/project/pytest-black/)