Skip to content

Commit 39cdaee

Browse files
committed
20 - Removing unsed code
1 parent 17a6476 commit 39cdaee

6 files changed

Lines changed: 9 additions & 44 deletions

File tree

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ source .pylint-plugin-utils/bin/activate
1818
pip install --upgrade pip setuptools
1919
```
2020

21-
We use [tox](https://tox.readthedocs.io/en/latest/) and [pytest-benchmark](https://pytest-benchmark.readthedocs.io/en/latest/index.html) for running the test suite. You should be able to install it with:
21+
We use [tox](https://tox.readthedocs.io/en/latest/) for running the test suite. You should be able to install it with:
2222
```bash
23-
pip install tox pytest pytest-benchmark
23+
pip install tox pytest
2424
```
2525

2626
To run the test suite for a particular Python version, you can do:
@@ -30,7 +30,7 @@ tox -e py38
3030

3131
To run individual tests with ``tox``, you can do::
3232
```bash
33-
tox -e py38 -- -k name_of_the_test
33+
tox -e py38 -- -k test_linter_should_be_pickleable
3434
```
3535

3636
We use pytest_ for testing ``pylint``, which you can use without using ``tox`` for a faster development cycle.
@@ -43,8 +43,6 @@ python3 -m pytest tests/ --cov=pylint_plugin_utils
4343
coverage html
4444
```
4545

46-
47-
4846
# License
4947

5048
`pylint-plugin-utils` is available under the GPLv2 License.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
author_email="[email protected]",
3030
description=_short_description,
3131
version=_version,
32-
install_requires=["pylint>=1.7", "pytest"],
32+
install_requires=["pylint>=1.7"],
3333
packages=_packages,
3434
license="GPLv2",
3535
classifiers=_classifiers,

tests/conftest.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
# pylint: disable=redefined-outer-name
2-
from pathlib import Path
3-
41
import pytest
52
from pylint.lint import PyLinter
63

74

8-
@pytest.fixture()
9-
def tests_directory():
10-
return Path(__file__).parent
11-
12-
135
@pytest.fixture
146
def linter():
157
_linter = PyLinter()

tests/input/__init__.py

Whitespace-only changes.

tests/input/empty.py

Whitespace-only changes.

tests/test_linter_pickle.py

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
1-
import os
21
import pickle
3-
from typing import List
42

5-
import pytest
63
from pylint.checkers.typecheck import TypeChecker
7-
from pylint.lint import PyLinter
8-
from pylint.testutils import FunctionalTestFile
94

105
from pylint_plugin_utils import augment_visit, suppress_message
116

127

13-
def get_tests(input_dir: str) -> List[FunctionalTestFile]:
14-
cwd = os.path.dirname(os.path.abspath(__file__))
15-
input_dir = os.path.join(cwd, input_dir)
16-
17-
suite = []
18-
for file_name in os.listdir(input_dir):
19-
if file_name != "__init__.py" and file_name.endswith(".py"):
20-
suite.append(FunctionalTestFile(input_dir, file_name))
21-
22-
return suite
23-
24-
25-
TESTS = get_tests(input_dir="input")
26-
TESTS_NAMES = [t.base for t in TESTS]
27-
28-
298
def fake_augmentation_func(*args, **kwargs):
309
...
3110

@@ -34,17 +13,13 @@ def fake_suppress_func(*args, **kwargs):
3413
...
3514

3615

37-
@pytest.mark.parametrize("test_file", TESTS, ids=TESTS_NAMES)
38-
def test_linter_pickleable_for_multithreading_as_default_for_py38_or_above(
39-
test_file,
40-
):
16+
def test_linter_should_be_pickleable(linter):
4117
# Setup
42-
pylinter = PyLinter()
43-
pylinter.register_checker(TypeChecker())
44-
augment_visit(pylinter, TypeChecker.visit_attribute, fake_augmentation_func)
18+
linter.register_checker(TypeChecker())
19+
augment_visit(linter, TypeChecker.visit_attribute, fake_augmentation_func)
4520
suppress_message(
46-
pylinter, TypeChecker.visit_attribute, "no-member", fake_suppress_func
21+
linter, TypeChecker.visit_attribute, "no-member", fake_suppress_func
4722
)
4823

4924
# Act and Assert
50-
pickle.dumps(pylinter)
25+
pickle.dumps(linter)

0 commit comments

Comments
 (0)