From 7a0dacf36ee6942d43c0f6a1820f8ad5a39a6884 Mon Sep 17 00:00:00 2001 From: Nataliia Date: Fri, 4 Nov 2022 13:00:30 +0200 Subject: [PATCH] inspect remade --- tests/test_main.py | 264 ++++++++++++++++++++++----------------------- 1 file changed, 132 insertions(+), 132 deletions(-) diff --git a/tests/test_main.py b/tests/test_main.py index 13de720e..5433778f 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -14,34 +14,34 @@ "error_linter,error_mate", [ ( - { - "code": "E501", - "filename": "./source_code_2.py", - "line_number": 18, - "column_number": 80, - "text": "line too long (99 > 79 characters)", - "physical_line": ' return f"I like to filter, rounding, doubling, ' - "store and decorate numbers: {', '.join(items)}!\"", - }, - { - "line": 18, - "column": 80, - "message": "line too long (99 > 79 characters)", - "name": "E501", - "source": "flake8", - }, + { + "code": "E501", + "filename": "./source_code_2.py", + "line_number": 18, + "column_number": 80, + "text": "line too long (99 > 79 characters)", + "physical_line": ' return f"I like to filter, rounding, doubling, ' + "store and decorate numbers: {', '.join(items)}!\"", + }, + { + "line": 18, + "column": 80, + "message": "line too long (99 > 79 characters)", + "name": "E501", + "source": "flake8", + }, ), ( - { - "code": "E702", - "filename": "./source_code_1.py", - "line_number": 3, - "column_number": 74, - "text": "multiple statements on one line (semicolon)", - "physical_line": ' new_items = [f"{key} -> {value}" for key, ' - "value in items.items()]; return func(new_items)\n", - }, - { + { + "code": "E702", + "filename": "./source_code_1.py", + "line_number": 3, + "column_number": 74, + "text": "multiple statements on one line (semicolon)", + "physical_line": ' new_items = [f"{key} -> {value}" for key, ' + "value in items.items()]; return func(new_items)\n", + }, + { "line": 3, "column": 74, "message": "multiple statements on one line (semicolon)", @@ -50,15 +50,15 @@ }, ), ( - { - "code": "E302", - "filename": "./source_code_1.py", - "line_number": 15, - "column_number": 1, - "text": "expected 2 blank lines, found 1", - "physical_line": "def number_filter(func):\n", - }, - { + { + "code": "E302", + "filename": "./source_code_1.py", + "line_number": 15, + "column_number": 1, + "text": "expected 2 blank lines, found 1", + "physical_line": "def number_filter(func):\n", + }, + { "line": 15, "column": 1, "message": "expected 2 blank lines, found 1", @@ -94,7 +94,7 @@ def test_format_functions_one_line(func): "file_path,errors,result", [ ( - "./source_code_2.py", + "./source_code_2.py", [ { "code": "E501", @@ -150,102 +150,102 @@ def test_format_single_linter_file(file_path, errors, result): "errors_linter,errors_mate", [ ( - { - "./test_source_code_2.py": [], - "./source_code_2.py": [ - { - "code": "E501", - "filename": "./source_code_2.py", - "line_number": 18, - "column_number": 80, - "text": "line too long (99 > 79 characters)", - "physical_line": ' return f"I like to filter, rounding, doubling, ' - "store and decorate numbers: {', '.join(items)}!\"", - }, - { - "code": "W292", - "filename": "./source_code_2.py", - "line_number": 18, - "column_number": 100, - "text": "no newline at end of file", - "physical_line": ' return f"I like to filter, rounding, doubling, ' - "store and decorate numbers: {', '.join(items)}!\"", - }, - ], - "./source_code_1.py": [ - { - "code": "E702", - "filename": "./source_code_1.py", - "line_number": 3, - "column_number": 74, - "text": "multiple statements on one line (semicolon)", - "physical_line": ' new_items = [f"{key} -> {value}" for key, ' - "value in items.items()]; return func(new_items)\n", - }, - { - "code": "E501", - "filename": "./source_code_1.py", - "line_number": 3, - "column_number": 80, - "text": "line too long (97 > 79 characters)", - "physical_line": ' new_items = [f"{key} -> {value}" for key, ' - "value in items.items()]; return func(new_items)\n", - }, - { - "code": "E302", - "filename": "./source_code_1.py", - "line_number": 15, - "column_number": 1, - "text": "expected 2 blank lines, found 1", - "physical_line": "def number_filter(func):\n", - }, - { - "code": "E303", - "filename": "./source_code_1.py", - "line_number": 27, - "column_number": 1, - "text": "too many blank lines (6)", - "physical_line": "@number_filter\n", - }, - { - "code": "E501", - "filename": "./source_code_1.py", - "line_number": 31, - "column_number": 80, - "text": "line too long (99 > 79 characters)", - "physical_line": ' return f"I like to filter, rounding, doubling, ' - "store and decorate numbers: {', '.join(items)}!\"\n", - }, - ], - "./test_source_code_1.py": [ - { - "code": "E302", - "filename": "./test_source_code_1.py", - "line_number": 4, - "column_number": 1, - "text": "expected 2 blank lines, found 1", - "physical_line": "@pytest.mark.parametrize(\n", - }, - { - "code": "E501", - "filename": "./test_source_code_1.py", - "line_number": 32, - "column_number": 80, - "text": "line too long (84 > 79 characters)", - "physical_line": ' "decorate numbers: 1 -> 2, 2 -> 4, 6 -> 12, -111 -> -222, -50 -> ' - '-100!",\n', - }, - { - "code": "W292", - "filename": "./test_source_code_1.py", - "line_number": 112, - "column_number": 6, - "text": "no newline at end of file", - "physical_line": " )", - }, - ], - }, - [ + { + "./test_source_code_2.py": [], + "./source_code_2.py": [ + { + "code": "E501", + "filename": "./source_code_2.py", + "line_number": 18, + "column_number": 80, + "text": "line too long (99 > 79 characters)", + "physical_line": ' return f"I like to filter, rounding, doubling, ' + "store and decorate numbers: {', '.join(items)}!\"", + }, + { + "code": "W292", + "filename": "./source_code_2.py", + "line_number": 18, + "column_number": 100, + "text": "no newline at end of file", + "physical_line": ' return f"I like to filter, rounding, doubling, ' + "store and decorate numbers: {', '.join(items)}!\"", + }, + ], + "./source_code_1.py": [ + { + "code": "E702", + "filename": "./source_code_1.py", + "line_number": 3, + "column_number": 74, + "text": "multiple statements on one line (semicolon)", + "physical_line": ' new_items = [f"{key} -> {value}" for key, ' + "value in items.items()]; return func(new_items)\n", + }, + { + "code": "E501", + "filename": "./source_code_1.py", + "line_number": 3, + "column_number": 80, + "text": "line too long (97 > 79 characters)", + "physical_line": ' new_items = [f"{key} -> {value}" for key, ' + "value in items.items()]; return func(new_items)\n", + }, + { + "code": "E302", + "filename": "./source_code_1.py", + "line_number": 15, + "column_number": 1, + "text": "expected 2 blank lines, found 1", + "physical_line": "def number_filter(func):\n", + }, + { + "code": "E303", + "filename": "./source_code_1.py", + "line_number": 27, + "column_number": 1, + "text": "too many blank lines (6)", + "physical_line": "@number_filter\n", + }, + { + "code": "E501", + "filename": "./source_code_1.py", + "line_number": 31, + "column_number": 80, + "text": "line too long (99 > 79 characters)", + "physical_line": ' return f"I like to filter, rounding, doubling, ' + "store and decorate numbers: {', '.join(items)}!\"\n", + }, + ], + "./test_source_code_1.py": [ + { + "code": "E302", + "filename": "./test_source_code_1.py", + "line_number": 4, + "column_number": 1, + "text": "expected 2 blank lines, found 1", + "physical_line": "@pytest.mark.parametrize(\n", + }, + { + "code": "E501", + "filename": "./test_source_code_1.py", + "line_number": 32, + "column_number": 80, + "text": "line too long (84 > 79 characters)", + "physical_line": ' "decorate numbers: 1 -> 2, 2 -> 4, 6 -> 12, -111 -> -222, -50 -> ' + '-100!",\n', + }, + { + "code": "W292", + "filename": "./test_source_code_1.py", + "line_number": 112, + "column_number": 6, + "text": "no newline at end of file", + "physical_line": " )", + }, + ], + }, + [ {"errors": [], "path": "./test_source_code_2.py", "status": "passed"}, { "errors": [