From d5457a8f66436fa1f65b15b2fdeff44eff8d55c0 Mon Sep 17 00:00:00 2001 From: jsh9 <25124332+jsh9@users.noreply.github.com> Date: Tue, 22 Aug 2023 01:38:09 -0700 Subject: [PATCH] Improve test case folder structure; tweak code style --- .../{edge_case_01.py => 01/case.py} | 0 .../syntax_error_in_type_hints.py} | 0 .../union_return_type.py} | 0 tests/test_main.py | 24 +++++-------------- 4 files changed, 6 insertions(+), 18 deletions(-) rename tests/data/edge_cases/{edge_case_01.py => 01/case.py} (100%) rename tests/data/edge_cases/{edge_case_02_syntax_error_in_type_hints.py => 02/syntax_error_in_type_hints.py} (100%) rename tests/data/edge_cases/{edge_case_03_union_return_type.py => 03/union_return_type.py} (100%) diff --git a/tests/data/edge_cases/edge_case_01.py b/tests/data/edge_cases/01/case.py similarity index 100% rename from tests/data/edge_cases/edge_case_01.py rename to tests/data/edge_cases/01/case.py diff --git a/tests/data/edge_cases/edge_case_02_syntax_error_in_type_hints.py b/tests/data/edge_cases/02/syntax_error_in_type_hints.py similarity index 100% rename from tests/data/edge_cases/edge_case_02_syntax_error_in_type_hints.py rename to tests/data/edge_cases/02/syntax_error_in_type_hints.py diff --git a/tests/data/edge_cases/edge_case_03_union_return_type.py b/tests/data/edge_cases/03/union_return_type.py similarity index 100% rename from tests/data/edge_cases/edge_case_03_union_return_type.py rename to tests/data/edge_cases/03/union_return_type.py diff --git a/tests/test_main.py b/tests/test_main.py index 35bb0e6..955357c 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -1012,9 +1012,9 @@ def testNonAscii() -> None: @pytest.mark.parametrize( 'filename, options, expectedViolations', [ - ('edge_case_01.py', {'style': 'sphinx'}, []), + ('01/case.py', {'style': 'sphinx'}, []), ( - 'edge_case_02_syntax_error_in_type_hints.py', + '02/syntax_error_in_type_hints.py', {'style': 'numpy'}, [ 'DOC106: Function `func1`: The option `--arg-type-hints-in-signature` is ' @@ -1035,7 +1035,7 @@ def testNonAscii() -> None: ], ), ( - 'edge_case_03_union_return_type.py', + '03/union_return_type.py', {'style': 'google'}, [ 'DOC203: Function `myFunc` return type(s) in docstring not consistent with ' @@ -1043,21 +1043,9 @@ def testNonAscii() -> None: "docstring return section types: ['str | bool | float']" ], ), - ( - '04_backticks/google.py', - {'style': 'google'}, - [], - ), - ( - '04_backticks/numpy.py', - {'style': 'numpy'}, - [], - ), - ( - '04_backticks/numpy.py', - {'style': 'numpy'}, - [], - ), + ('04_backticks/google.py', {'style': 'google'}, []), + ('04_backticks/numpy.py', {'style': 'numpy'}, []), + ('04_backticks/numpy.py', {'style': 'numpy'}, []), ('05_escape_char/google.py', {'style': 'google'}, []), ('05_escape_char/numpy.py', {'style': 'numpy'}, []), ('05_escape_char/sphinx.py', {'style': 'sphinx'}, []),