Socket
Socket
Sign inDemoInstall

pytest-black

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pytest-black

A pytest plugin to enable format checking with black


Maintainers
1

Readme

pytest-black

Build Status

A pytest plugin to enable format checking with black.

Requirements

There is a minimum requirement of black 19.3b0 or later.

Installation

$ pip install pytest-black

Usage

To run pytest with formatting checks provided by black:

$ pytest --black

The plugin will output a diff of suggested formatting changes (if any exist). Changes will not be applied automatically.

Configuration

You can override default black configuration options by placing a pyproject.toml file in your project directory. See example configuration here.

Python package management

For poetry to work correctly, include this in your pyproject.toml configuration file:

[tool.poetry.dev-dependencies]
...
black = { version = "*", allow-prereleases = true }
...

This is necessary because at the time of writing all the black releases in PyPI have been tagged as pre-releases (beta code), which breaks poetry's dependency resolution.

Testing

To run the tests against a selection of Python interpreters:

$ tox

To run against a specific interpreter (e.g. Python 3.6):

$ tox -e py36

The tox.ini file in the root of this repository is used to configure the test environment.

License

Distributed under the terms of the MIT license, pytest-black is free and open source software

Issues

If you encounter any problems, please file an issue along with a detailed description.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc