This repository was archived by the owner on Apr 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +65
-5
lines changed Expand file tree Collapse file tree 3 files changed +65
-5
lines changed Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ ## [ Unreleased]
4
+ ### Fixed
5
+ - Fix fixtures defined with ` @pytest.yield_fixture ` decorator still showing FP
6
+
7
+ ## [ 0.1.1] - 2020-05-19
8
+ ### Fixed
9
+ - Fix crashes when ` *args ` or ` **kwargs ` is used in FuncDef
10
+
11
+ ## [ 0.1] - 2020-05-18
12
+ ### Added
13
+ - Suppressing FP ` unused-import ` with tests
14
+ - Suppressing FP ` unused-argument ` with tests
15
+ - Suppressing FP ` redefined-outer-scope ` with tests
16
+ - Add CI/CD configuration with Travis CI
Original file line number Diff line number Diff line change 1
1
# pylint-pytest
2
2
3
- A Pylint plugin to suppress false positive pylint warnings about pytest fixtures.
3
+ [ ![ PyPI version fury.io] ( https://badge.fury.io/py/pylint-pytest.svg )] ( https://pypi.python.org/pypi/pylint-pytest/ )
4
+ [ ![ Travis CI] ( https://travis-ci.org/reverbc/pylint-pytest.svg?branch=master )] ( https://travis-ci.org/reverbc/pylint-pytest )
5
+
6
+ A Pylint plugin to suppress pytest-related false positives.
4
7
5
8
## Installation
6
9
10
+ Requirements:
11
+
12
+ - ` pylint `
13
+ - ` pytest>=4.6 `
14
+
7
15
To install:
8
16
9
17
``` bash
@@ -12,27 +20,55 @@ $ pip install pylint-pytest
12
20
13
21
## Usage
14
22
23
+ Enable via command line option ` --load-plugins `
24
+
15
25
``` bash
16
26
$ pylint --load-plugins pylint_pytest < path_to_your_sources>
17
27
```
18
28
19
- Or
29
+ Or in ` pylintrc ` :
30
+
31
+ ``` ini
32
+ [MASTER]
33
+ load-plugins =pylint_pytest
34
+ ```
20
35
21
36
## Suppressed Pylint Warnings
22
37
23
38
### ` unused-argument `
24
39
40
+ FP when a fixture is used in an applicable function but not referenced in the function body, e.g.
25
41
42
+ ``` python
43
+ def test_something (conftest_fixture ): # <- Unused argument 'conftest_fixture'
44
+ assert True
45
+ ```
26
46
27
47
### ` unused-import `
28
48
49
+ FP when an imported fixture is used in an applicable function, e.g.
50
+
51
+ ``` python
52
+ from fixture_collections import imported_fixture # <- Unused imported_fixture imported from fixture_collections
53
+
54
+ def test_something (imported_fixture ):
55
+ ...
56
+ ```
29
57
30
58
### ` redefined-outer-name `
31
59
60
+ FP when an imported/declared fixture is used in an applicable function, e.g.
61
+
62
+ ``` python
63
+ from fixture_collections import imported_fixture
64
+
65
+ def test_something (imported_fixture ): # <- Redefining name 'imported_fixture' from outer scope (line 1)
66
+ ...
67
+ ```
32
68
33
- ## Tests
69
+ ## Changelog
34
70
35
- TBD
71
+ See [ CHANGELOG ] ( CHANGELOG.md ) .
36
72
37
73
## License
38
74
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
3
4
+ from os import path
4
5
from setuptools import setup
5
6
6
7
8
+ here = path .abspath (path .dirname (__file__ ))
9
+ with open (path .join (here , 'README.md' )) as fin :
10
+ long_description = fin .read ()
11
+
12
+
7
13
setup (
8
14
name = 'pylint-pytest' ,
9
15
version = '0.1.1' ,
13
19
maintainer_email = '[email protected] ' ,
14
20
license = 'MIT' ,
15
21
url = 'https://github.com/reverbc/pylint-pytest' ,
16
- description = 'A Pylint plugin to suppress pytest fixture related false positive warnings.' ,
22
+ description = 'A Pylint plugin to suppress pytest-related false positives.' ,
23
+ long_description = long_description ,
24
+ long_description_content_type = 'text/markdown' ,
17
25
py_modules = ['pylint_pytest' ],
18
26
install_requires = [
19
27
'pylint' ,
You can’t perform that action at this time.
0 commit comments