{"library":"pytest-black","title":"pytest-black Plugin","description":"pytest-black is a pytest plugin that enables code format checking using the 'black' formatter directly within the pytest test suite. It integrates `black` as a linter, failing tests if code is not formatted according to `black`'s standards. The current version is 0.6.0, with releases typically occurring on an annual to bi-annual cadence.","language":"python","status":"active","last_verified":"Thu Apr 16","install":{"commands":["pip install pytest-black"],"cli":null},"imports":["Install 'pytest-black' and run 'pytest --black'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pytest\n\n# Create a test file (e.g., test_example.py)\n# with some unformatted code:\n# def test_hello():\n#    print(   'Hello, World!')\n#    assert True\n\n# To run:\n# 1. Save the above unformatted code in test_example.py\n# 2. Run in terminal: pip install pytest-black black pytest\n# 3. Run in terminal: pytest --black\n\n# Expected output for unformatted code would include black errors.\n# If code is formatted, it would pass without black errors.\n","lang":"python","description":"To quickly start using pytest-black, install the plugin along with black and pytest. Then, simply run pytest with the `--black` flag. pytest-black will check all Python files found by pytest for black compliance. If any files are unformatted, tests will fail.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}