All Projects → reverbc → pylint-pytest

reverbc / pylint-pytest

Licence: MIT license
A Pylint plugin to suppress pytest-related false positives.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pylint-pytest

continuous-integration-with-python
How to test your python code. How to automatically run your tests for your Python code. How to get reports of the tests coverage
Stars: ✭ 25 (+1150%)
Mutual labels:  pytest, pylint
pylint runner
Python module that recursively runs pylint on python files in current directory and any sub-directories
Stars: ✭ 19 (+850%)
Mutual labels:  pylint
Cookiecutter Pytest Plugin
A Cookiecutter template for pytest plugins 💻
Stars: ✭ 181 (+8950%)
Mutual labels:  pytest
Best Of Python Dev
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.
Stars: ✭ 243 (+12050%)
Mutual labels:  pytest
Pytest Chinese Doc
pytest 官方文档的中文翻译,但不仅仅是单纯的翻译,也包含自己的理解和实践。
Stars: ✭ 192 (+9500%)
Mutual labels:  pytest
agent-python-pytest
Framework integration with PyTest
Stars: ✭ 86 (+4200%)
Mutual labels:  pytest
Pytest Lazy Fixture
It helps to use fixtures in pytest.mark.parametrize
Stars: ✭ 179 (+8850%)
Mutual labels:  pytest
overhave
Web-framework for BDD: scalable, configurable, easy to use, based on Flask Admin and Pydantic.
Stars: ✭ 61 (+2950%)
Mutual labels:  pytest
pytest-neo
Matrix has you...
Stars: ✭ 44 (+2100%)
Mutual labels:  pytest
Pytest Selenium
Plugin for running Selenium with pytest
Stars: ✭ 246 (+12200%)
Mutual labels:  pytest
Httprunner
One-stop solution for HTTP(S) testing, written in Python.
Stars: ✭ 2,628 (+131300%)
Mutual labels:  pytest
Cookiecutter Cms
Python-centric Cookiecutter for Molecular Computational Chemistry Packages
Stars: ✭ 197 (+9750%)
Mutual labels:  pytest
stock reminder bot
A twitter bot that reminds you of stock and crypto predictions
Stars: ✭ 25 (+1150%)
Mutual labels:  pytest
Django Test Migrations
Test django schema and data migrations, including migrations' order and best practices.
Stars: ✭ 188 (+9300%)
Mutual labels:  pytest
web-ui
python+selenium+pytest+allure UI 自动化框架
Stars: ✭ 199 (+9850%)
Mutual labels:  pytest
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. 🧠💡
Stars: ✭ 2,520 (+125900%)
Mutual labels:  pytest
Pytest Qt
pytest plugin for Qt (PyQt4, PyQt5 and PySide) application testing
Stars: ✭ 210 (+10400%)
Mutual labels:  pytest
ci-testing-python
Sample Microservice App in Python for Testing using pytest, uber/doubles, tox on CI servers like Jenkins and Travis CI using Docker + Docker-Compose for test environment.
Stars: ✭ 37 (+1750%)
Mutual labels:  pytest
vscode-linter
Extension for code linting, all in one package. New linters can be easily added through an extension framework.
Stars: ✭ 47 (+2250%)
Mutual labels:  pylint
Semantic-Textual-Similarity
Natural Language Processing using NLTK and Spacy
Stars: ✭ 30 (+1400%)
Mutual labels:  pytest

pylint-pytest

PyPI version fury.io Travis CI AppVeyor

A Pylint plugin to suppress pytest-related false positives.

Installation

Requirements:

  • pylint
  • pytest>=4.6

To install:

$ pip install pylint-pytest

Usage

Enable via command line option --load-plugins

$ pylint --load-plugins pylint_pytest <path_to_your_sources>

Or in pylintrc:

[MASTER]
load-plugins=pylint_pytest

Suppressed Pylint Warnings

unused-argument

FP when a fixture is used in an applicable function but not referenced in the function body, e.g.

def test_something(conftest_fixture):  # <- Unused argument 'conftest_fixture'
    assert True

unused-import

FP when an imported fixture is used in an applicable function, e.g.

from fixture_collections import imported_fixture  # <- Unused imported_fixture imported from fixture_collections

def test_something(imported_fixture):
    ...

redefined-outer-name

FP when an imported/declared fixture is used in an applicable function, e.g.

from fixture_collections import imported_fixture

def test_something(imported_fixture):  # <- Redefining name 'imported_fixture' from outer scope (line 1)
    ...

no-member

FP when class attributes are defined in setup fixtures

import pytest

class TestClass(object):
    @staticmethod
    @pytest.fixture(scope='class', autouse=True)
    def setup_class(request):
        cls = request.cls
        cls.defined_in_setup_class = True

    def test_foo(self):
        assert self.defined_in_setup_class  # <- Instance of 'TestClass' has no 'defined_in_setup_class' member

Raise new warning(s)

W6401 deprecated-pytest-yield-fixture

Raise when using deprecated @pytest.yield_fixture decorator (ref)

import pytest

@pytest.yield_fixture  # <- Using a deprecated @pytest.yield_fixture decorator
def yield_fixture():
    yield

W6402 useless-pytest-mark-decorator

Raise when using every @pytest.mark.* for the fixture (ref)

import pytest

@pytest.fixture
def awesome_fixture():
    ...

@pytest.fixture
@pytest.mark.usefixtures("awesome_fixture")  # <- Using useless `@pytest.mark.*` decorator for fixtures
def another_awesome_fixture():
    ...

W6403 deprecated-positional-argument-for-pytest-fixture

Raise when using deprecated positional arguments for fixture decorator (ref)

import pytest

@pytest.fixture("module")  # <- Using a deprecated positional arguments for fixture
def awesome_fixture():
    ...

F6401 cannot-enumerate-pytest-fixtures

Raise when the plugin cannot enumerate and collect pytest fixtures for analysis

NOTE: this warning is only added to test modules (test_*.py / *_test.py)

import no_such_package  # <- pylint-pytest plugin cannot enumerate and collect pytest fixtures

Changelog

See CHANGELOG.

License

pylint-pytest is available under MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].