diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-11-29 14:34:31 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2020-11-29 16:16:08 +0100 |
commit | 344f2d8ce742d3f35d808b379d1d80234e336499 (patch) | |
tree | e54af9b4d041123ef4ea5799cb0feb6a669cee2a | |
parent | 2e21eb481cd9229931af8d303b7e9adbe7887503 (diff) | |
download | pylint-git-344f2d8ce742d3f35d808b379d1d80234e336499.tar.gz |
Make the .txt file optional in functional tests
If there is no error reported we don't need an empty file
-rw-r--r-- | pylint/testutils/lint_module_test.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pylint/testutils/lint_module_test.py b/pylint/testutils/lint_module_test.py index 6a53007ae..3b864184a 100644 --- a/pylint/testutils/lint_module_test.py +++ b/pylint/testutils/lint_module_test.py @@ -6,6 +6,7 @@ import csv import itertools import platform import sys +from io import StringIO from typing import Tuple import pytest @@ -132,7 +133,10 @@ class LintModuleTest: return missing, unexpected def _open_expected_file(self): - return open(self._test_file.expected_output) + try: + return open(self._test_file.expected_output) + except FileNotFoundError: + return StringIO("") def _open_source_file(self): if self._test_file.base == "invalid_encoded_data": |