diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-10-24 16:33:59 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-10-30 18:22:32 +0100 |
commit | 62ae31bd8d858603d13a7596320462812b297637 (patch) | |
tree | c060f9bc2adf7534d905ecbda33f3e370c920103 /tests/test_functional.py | |
parent | 849928ddff44762f986db4687ada0e4666fd0b3d (diff) | |
download | pylint-git-62ae31bd8d858603d13a7596320462812b297637.tar.gz |
Add a warning when an output file is updated
Diffstat (limited to 'tests/test_functional.py')
-rw-r--r-- | tests/test_functional.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/test_functional.py b/tests/test_functional.py index 269b267be..4b3df779f 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -25,6 +25,7 @@ import csv import io import os import sys +import warnings from pathlib import Path import pytest @@ -65,8 +66,14 @@ class LintModuleOutputUpdate(testutils.LintModuleTest): return emitted, remaining = self._split_lines(expected_messages, expected_lines) if emitted != received_lines: + remaining.extend(received_lines) remaining.sort(key=lambda m: (m[1], m[0], m[3])) + warnings.warn( + "Updated '{}' with the new content generated from '{}'".format( + self._test_file.expected_output, self._test_file.base + ) + ) with open(self._test_file.expected_output, "w") as fobj: writer = csv.writer(fobj, dialect="test") for line in remaining: @@ -111,5 +118,4 @@ if __name__ == "__main__": sys.argv.remove(update_option) pytest.main(sys.argv) if UPDATE.exists(): - print("The expected output for functional tests has been updated.") UPDATE.unlink() |