diff options
author | Ollie <46904826+ollie-iterators@users.noreply.github.com> | 2023-02-25 16:12:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-25 22:12:29 +0100 |
commit | 02030cf52dbbed3a8bb7c14c4d6158427635cee5 (patch) | |
tree | 5c1006b9695be3a05870070c30f55784172e068a /tests | |
parent | c785e3edb82683e50d5d370c1c4e992ebda036a0 (diff) | |
download | pylint-git-02030cf52dbbed3a8bb7c14c4d6158427635cee5.tar.gz |
Fixing some too long lines (#8339)
* Changing flake8 max-line-length to 120
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/checkers/unittest_utils.py | 10 | ||||
-rw-r--r-- | tests/config/test_config.py | 8 | ||||
-rw-r--r-- | tests/config/test_functional_config_loading.py | 16 | ||||
-rw-r--r-- | tests/test_self.py | 4 | ||||
-rw-r--r-- | tests/test_similar.py | 3 |
5 files changed, 23 insertions, 18 deletions
diff --git a/tests/checkers/unittest_utils.py b/tests/checkers/unittest_utils.py index 2f0bf0e08..b2cbcb590 100644 --- a/tests/checkers/unittest_utils.py +++ b/tests/checkers/unittest_utils.py @@ -484,12 +484,14 @@ def test_deprecation_check_messages() -> None: def visit_assname(self, node: nodes.NodeNG) -> None: pass - assert len(records) == 1 - assert ( - records[0].message.args[0] - == "utils.check_messages will be removed in favour of calling utils.only_required_for_messages in pylint 3.0" + deprecationMessage = ( + "utils.check_messages will be removed in " + "favour of calling utils.only_required_for_messages in pylint 3.0" ) + assert len(records) == 1 + assert records[0].message.args[0] == deprecationMessage + def test_is_typing_member() -> None: code = astroid.extract_node( diff --git a/tests/config/test_config.py b/tests/config/test_config.py index be28d324b..5eab597fd 100644 --- a/tests/config/test_config.py +++ b/tests/config/test_config.py @@ -121,10 +121,12 @@ def test_regex_error(capsys: CaptureFixture) -> None: exit=False, ) output = capsys.readouterr() - assert ( - r"Error in provided regular expression: [\p{Han}a-z_][\p{Han}a-z0-9_]{2,30}$ beginning at index 1: bad escape \p" - in output.err + + assertString = ( + r"Error in provided regular expression: [\p{Han}a-z_][\p{Han}a-z0-9_]{2,30}$ " + r"beginning at index 1: bad escape \p" ) + assert assertString in output.err def test_csv_regex_error(capsys: CaptureFixture) -> None: diff --git a/tests/config/test_functional_config_loading.py b/tests/config/test_functional_config_loading.py index 432bdc1a1..d5a2ba7ca 100644 --- a/tests/config/test_functional_config_loading.py +++ b/tests/config/test_functional_config_loading.py @@ -6,15 +6,15 @@ files by providing a file with the appropriate extension in the ``tests/config/functional`` directory. -Let's say you have a regression_list_crash.toml file to test. Then, if there is an error in the conf, -add ``regression_list_crash.out`` alongside your file with the expected output of pylint in it. Use -``{relpath}`` and ``{abspath}`` for the path of the file. The exit code will have to be 2 (error) -if this file exists. +Let's say you have a regression_list_crash.toml file to test. Then, if there is an error in the +conf, add ``regression_list_crash.out`` alongside your file with the expected output of pylint in +it. Use ``{relpath}`` and ``{abspath}`` for the path of the file. The exit code will have to be 2 + (error) if this file exists. -You must also define a ``regression_list_crash.result.json`` if you want to check the parsed configuration. -This file will be loaded as a dict and will override the default value of the default pylint -configuration. If you need to append or remove a value use the special key ``"functional_append"`` -and ``"functional_remove":``. Check the existing code for examples. +You must also define a ``regression_list_crash.result.json`` if you want to check the parsed +configuration. This file will be loaded as a dict and will override the default value of the +default pylint configuration. If you need to append or remove a value use the special key +``"functional_append"`` and ``"functional_remove":``. Check the existing code for examples. """ # pylint: disable=redefined-outer-name diff --git a/tests/test_self.py b/tests/test_self.py index 7dbbcf565..07c2a2f0b 100644 --- a/tests/test_self.py +++ b/tests/test_self.py @@ -716,8 +716,8 @@ a.py:1:4: E0001: Parsing failed: 'invalid syntax (<unknown>, line 1)' (syntax-er @pytest.mark.parametrize( "fu_score,fo_msgs,fname,out", [ - # Essentially same test cases as --fail-under, but run with/without a detected issue code - # missing-function-docstring (C0116) is issue in both files + # Essentially same test cases as --fail-under, but run with/without a detected + # issue code missing-function-docstring (C0116) is issue in both files # --fail-under should be irrelevant as missing-function-docstring is hit (-10, "missing-function-docstring", "fail_under_plus7_5.py", 16), (6, "missing-function-docstring", "fail_under_plus7_5.py", 16), diff --git a/tests/test_similar.py b/tests/test_similar.py index 5558b70e7..051bc4b27 100644 --- a/tests/test_similar.py +++ b/tests/test_similar.py @@ -207,7 +207,8 @@ class TestSimilarCodeChecker: ) def test_duplicate_code_raw_strings_disable_scope_function(self) -> None: - """Tests disabling duplicate-code at an inner scope level with another scope with similarity.""" + """Tests disabling duplicate-code at an inner scope level with another scope with + similarity.""" path = join(DATA, "raw_strings_disable_scope_second_function") expected_output = "Similar lines in 2 files" self._test_output( |