|
10 | 10 | import astroid
|
11 | 11 |
|
12 | 12 | from pylint.checkers import design_analysis
|
13 |
| -from pylint.testutils import CheckerTestCase, MessageTest, set_config |
| 13 | +from pylint.testutils import CheckerTestCase, set_config |
14 | 14 | from pylint.utils.utils import get_global_option
|
15 | 15 |
|
16 | 16 |
|
@@ -44,42 +44,6 @@ class Eeee(Dddd):
|
44 | 44 | with self.assertNoMessages():
|
45 | 45 | self.checker.visit_classdef(node)
|
46 | 46 |
|
47 |
| - def test_too_few_public_methods(self) -> None: |
48 |
| - """Tests the default ``min-public-methods`` config value of 2 |
49 |
| - triggers too-few-public-methods""" |
50 |
| - node = astroid.extract_node( |
51 |
| - """ |
52 |
| - class SomeModel: |
53 |
| - def dummy(self): |
54 |
| - pass |
55 |
| - """ |
56 |
| - ) |
57 |
| - message = MessageTest( |
58 |
| - "too-few-public-methods", |
59 |
| - node=node, |
60 |
| - args=(1, 2), |
61 |
| - ) |
62 |
| - with self.assertAddsMessages(message): |
63 |
| - self.checker.leave_classdef(node) |
64 |
| - |
65 |
| - @set_config(exclude_too_few_public_methods=("toml.*")) |
66 |
| - @set_config(min_public_methods=20) # to combat inherited methods |
67 |
| - def test_exclude_too_few_methods(self) -> None: |
68 |
| - """Tests config setting ``exclude-too-few-public-methods`` with a |
69 |
| - comma-separated regular expression suppresses the message for |
70 |
| - `too-few-public-methods` on classes that match the regular expression. |
71 |
| - """ |
72 |
| - node = astroid.extract_node( |
73 |
| - """ |
74 |
| - from toml import TomlEncoder |
75 |
| -
|
76 |
| - class MyTomlEncoder(TomlEncoder): |
77 |
| - ... |
78 |
| - """ |
79 |
| - ) |
80 |
| - with self.assertNoMessages(): |
81 |
| - self.checker.leave_classdef(node) |
82 |
| - |
83 | 47 | @set_config(exclude_too_few_public_methods="toml.*")
|
84 | 48 | def test_exclude_too_few_methods_with_value(self) -> None:
|
85 | 49 | """Test exclude-too-few-public-methods option with value"""
|
|
0 commit comments