summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2021-11-21 15:01:37 +0100
committerGitHub <noreply@github.com>2021-11-21 15:01:37 +0100
commit825dce1be9521a6a2f8b0e1e501d0d258ebb66bb (patch)
tree625d13156720bd4fee2566ca4d2da99f4d02ccf9
parentbcdb98a68407f57243b509dd35ab24c418485138 (diff)
downloadpylint-git-825dce1be9521a6a2f8b0e1e501d0d258ebb66bb.tar.gz
Update functional test updater to print actual string (#5351)
-rw-r--r--pylint/testutils/output_line.py9
-rw-r--r--tests/test_functional.py3
2 files changed, 9 insertions, 3 deletions
diff --git a/pylint/testutils/output_line.py b/pylint/testutils/output_line.py
index 9e5a071d2..4e08f1a7d 100644
--- a/pylint/testutils/output_line.py
+++ b/pylint/testutils/output_line.py
@@ -114,4 +114,11 @@ class OutputLine(NamedTuple):
raise MalformedOutputLineException(row, e) from e
def to_csv(self) -> Tuple[str, str, str, str, str, str]:
- return tuple(str(i) for i in self) # type: ignore[return-value] # pylint: disable=not-an-iterable
+ return (
+ str(self.symbol),
+ str(self.lineno),
+ str(self.column),
+ str(self.object),
+ str(self.msg),
+ str(self.confidence),
+ )
diff --git a/tests/test_functional.py b/tests/test_functional.py
index 513823a05..3512981d2 100644
--- a/tests/test_functional.py
+++ b/tests/test_functional.py
@@ -65,9 +65,8 @@ class LintModuleOutputUpdate(testutils.LintModuleTest):
os.remove(self._test_file.expected_output)
return
with open(self._test_file.expected_output, "w", encoding="utf-8") as f:
- writer = csv.writer(f, dialect="test")
for line in actual_output:
- writer.writerow(line.to_csv())
+ print(":".join(line.to_csv()), file=f)
def get_tests():