blob: b53f31d2f4fbce23fe62b5a531593df529a0d539 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
from pathlib import Path
import pytest
from pylint.extensions import empty_comment
@pytest.fixture(scope="module")
def checker():
return empty_comment.CommentChecker
@pytest.fixture(scope="module")
def enable():
return ["empty-comment"]
@pytest.fixture(scope="module")
def disable():
return ["all"]
def test_comment_base_case(linter):
comment_test = str(Path(__file__).parent.joinpath("data", "empty_comment.py"))
linter.check([comment_test])
msgs = linter.reporter.messages
assert len(msgs) == 4
for msg in msgs:
assert msg.symbol == "empty-comment"
assert msg.msg == "Line with empty comment"
assert msgs[0].line == 2
assert msgs[1].line == 3
assert msgs[2].line == 5
assert msgs[3].line == 7
|