1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
Metadata-Version: 2.1
Name: pytest-black
Version: 0.6.0
Summary: A pytest plugin to enable format checking with black
Home-page: https://github.com/coherent-oss/pytest-black
Author: ShopKeep, Inc.
Author-email: oss@shopkeep.com
Maintainer: Jason R. Coombs
Maintainer-email: jaraco@jaraco.com
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.5
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytest>=7.0.0
Requires-Dist: black; python_version >= "3.6"
Requires-Dist: toml
pytest-black
============
A pytest plugin to enable format checking with [black](https://github.com/ambv/black).
Requirements
------------
* [pytest](https://docs.pytest.org/en/latest/)
* [black](https://github.com/ambv/black)
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](https://github.com/ambv/black/blob/master/pyproject.toml).
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](https://github.com/coherent-oss/pytest-black/issues) along with a detailed description.
|