summaryrefslogtreecommitdiff
path: root/tests/testutils
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-01-11 22:13:44 +0100
committerGitHub <noreply@github.com>2022-01-11 22:13:44 +0100
commit7b7cc548cea64f7247de75d1ce849150152f2a5e (patch)
tree0e8a06098ecade9679805ade18d0a26b2141dd37 /tests/testutils
parent642268f636241e733409cb6cdf59f0eb87a03ae1 (diff)
downloadpylint-git-7b7cc548cea64f7247de75d1ce849150152f2a5e.tar.gz
Make sure to split non-separated csv ``OuputLine's`` (#5665)
* Make sure to split non-separated csv ``OuputLine's`` * Add test for too long output lines
Diffstat (limited to 'tests/testutils')
-rw-r--r--tests/testutils/test_output_line.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/testutils/test_output_line.py b/tests/testutils/test_output_line.py
index eafb3eb53..48ae10721 100644
--- a/tests/testutils/test_output_line.py
+++ b/tests/testutils/test_output_line.py
@@ -123,16 +123,27 @@ def test_output_line_to_csv(confidence: Confidence, message: Callable) -> None:
def test_output_line_from_csv_error() -> None:
"""Test that errors are correctly raised for incorrect OutputLine's."""
+ # Test a csv-string which does not have a number for line and column
with pytest.raises(
MalformedOutputLineException,
match="msg-symbolic-name:42:27:MyClass.my_function:The message",
):
OutputLine.from_csv("'missing-docstring', 'line', 'column', 'obj', 'msg'", True)
+ # Test a tuple which does not have a number for line and column
with pytest.raises(
MalformedOutputLineException, match="symbol='missing-docstring' ?"
):
csv = ("missing-docstring", "line", "column", "obj", "msg")
OutputLine.from_csv(csv, True)
+ # Test a csv-string that is too long
+ with pytest.raises(
+ MalformedOutputLineException,
+ match="msg-symbolic-name:42:27:MyClass.my_function:The message",
+ ):
+ OutputLine.from_csv(
+ "'missing-docstring', 1, 2, 'obj', 'msg', 'func', 'message', 'conf', 'too_long'",
+ True,
+ )
@pytest.mark.parametrize(