diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2019-07-21 21:53:05 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2019-07-22 12:39:50 +0200 |
commit | eae3436de87df5abb08a4583e345e7afa5510ac9 (patch) | |
tree | 9130a6ff159f8f972d731e861771024bbc476d0f /tests/extensions/test_check_docs_utils.py | |
parent | a598e2b5514da298aae821075ec1d444b53f9ab4 (diff) | |
download | pylint-git-eae3436de87df5abb08a4583e345e7afa5510ac9.tar.gz |
[black style] Apply black style on unformatted python file
Diffstat (limited to 'tests/extensions/test_check_docs_utils.py')
-rw-r--r-- | tests/extensions/test_check_docs_utils.py | 108 |
1 files changed, 72 insertions, 36 deletions
diff --git a/tests/extensions/test_check_docs_utils.py b/tests/extensions/test_check_docs_utils.py index 26af9db9d..bff75792c 100644 --- a/tests/extensions/test_check_docs_utils.py +++ b/tests/extensions/test_check_docs_utils.py @@ -17,47 +17,64 @@ import pytest import pylint.extensions._check_docs_utils as utils -@pytest.mark.parametrize("string,count", [ - ('abc', 0), - ('', 0), - (' abc', 2), - ('\n abc', 0), - (' \n abc', 3), -]) +@pytest.mark.parametrize( + "string,count", + [("abc", 0), ("", 0), (" abc", 2), ("\n abc", 0), (" \n abc", 3)], +) def test_space_indentation(string, count): """Test for pylint_plugin.ParamDocChecker""" assert utils.space_indentation(string) == count -@pytest.mark.parametrize("raise_node,expected", [ - (astroid.extract_node(''' +@pytest.mark.parametrize( + "raise_node,expected", + [ + ( + astroid.extract_node( + """ def my_func(): raise NotImplementedError #@ - '''), {"NotImplementedError"}), - - (astroid.extract_node(''' + """ + ), + {"NotImplementedError"}, + ), + ( + astroid.extract_node( + """ def my_func(): raise NotImplementedError("Not implemented!") #@ - '''), {"NotImplementedError"}), - - (astroid.extract_node(''' + """ + ), + {"NotImplementedError"}, + ), + ( + astroid.extract_node( + """ def my_func(): try: fake_func() except RuntimeError: raise #@ - '''), {"RuntimeError"}), - - (astroid.extract_node(''' + """ + ), + {"RuntimeError"}, + ), + ( + astroid.extract_node( + """ def my_func(): try: fake_func() except RuntimeError: if another_func(): raise #@ - '''), {"RuntimeError"}), - - (astroid.extract_node(''' + """ + ), + {"RuntimeError"}, + ), + ( + astroid.extract_node( + """ def my_func(): try: fake_func() @@ -67,9 +84,13 @@ def test_space_indentation(string, count): raise #@ except NameError: pass - '''), {"RuntimeError"}), - - (astroid.extract_node(''' + """ + ), + {"RuntimeError"}, + ), + ( + astroid.extract_node( + """ def my_func(): try: fake_func() @@ -78,34 +99,49 @@ def test_space_indentation(string, count): another_func() except NameError: raise #@ - '''), {"NameError"}), - - (astroid.extract_node(''' + """ + ), + {"NameError"}, + ), + ( + astroid.extract_node( + """ def my_func(): try: fake_func() except: raise #@ - '''), set()), - - (astroid.extract_node(''' + """ + ), + set(), + ), + ( + astroid.extract_node( + """ def my_func(): try: fake_func() except (RuntimeError, ValueError): raise #@ - '''), {"RuntimeError", "ValueError"}), - - (astroid.extract_node(''' + """ + ), + {"RuntimeError", "ValueError"}, + ), + ( + astroid.extract_node( + """ import not_a_module def my_func(): try: fake_func() except not_a_module.Error: raise #@ - '''), set()), - -]) + """ + ), + set(), + ), + ], +) def test_exception(raise_node, expected): found = utils.possible_exc_types(raise_node) assert found == expected |