Skip to main content

A flake8 extension that checks test extra style

Project description

flake8-fine-pytest

Build Status Maintainability Test Coverage

An extension for flake8 that validates tests structure, extra style and readability.

Right now our checker:

  1. validates existence of reason in
@pytest.mark.xfail(reason='Super annoying test, fix it later')

It helps everyone easily understand what was the problem in the first place and reduces amount of time wasted on fixing xfailed tests.

Installation

pip install flake8-fine-pytest

Example

Sample file:

# test.py

@pytest.mark.xfail(reason='')
def test_xfail() -> None:
    pass

@pytest.mark.xfail
def test_xfail() -> None:
    pass

Usage:

$ flake8 test.py
test.py:1:1: FP001 xfailed test with empty reason
test.py:5:1: FP002 xfailed test without reason

Contributing

We would love you to contribute to our project. It's simple:

  1. Create an issue with bug you found or proposal you have. Wait for approve from maintainer.
  2. Create a pull request. Make sure all checks are green.
  3. Fix review comments if any.
  4. Be awesome.

Here are useful tips:

  • You can run all checks and tests with make check. Please do it before TravisCI does.
  • We use BestDoctor python styleguide. Sorry, styleguide is available only in Russian for now.
  • We respect Django CoC. Make soft, not bullshit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_fine_pytest-0.0.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page