From f66937947c99a5e7a2a01840af9cd7c3dc3af47d Mon Sep 17 00:00:00 2001 From: Uros <115799310+KatanicU@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:17:53 +0200 Subject: [PATCH] change path --- pre_commit_hooks/tests_should_end_in_test.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/pre_commit_hooks/tests_should_end_in_test.py b/pre_commit_hooks/tests_should_end_in_test.py index 0452027..8c34215 100644 --- a/pre_commit_hooks/tests_should_end_in_test.py +++ b/pre_commit_hooks/tests_should_end_in_test.py @@ -14,30 +14,17 @@ def main(argv: Sequence[str] | None = None) -> int: '--pytest', dest='pattern', action='store_const', - const=r'tests_*\.py', - default=r'tests_*\.py', + const=r'.*/tests_*\.py', + default=r'.*/tests_*\.py', help='(the default) ensure tests match %(const)s', ) - mutex.add_argument( - '--pytest-test-first', - dest='pattern', - action='store_const', - const=r'test_.*\.py', - help='ensure tests match %(const)s', - ) - mutex.add_argument( - '--django', '--unittest', - dest='pattern', - action='store_const', - const=r'test.*\.py', - help='ensure tests match %(const)s', - ) args = parser.parse_args(argv) retcode = 0 reg = re.compile(args.pattern) for filename in args.filenames: base = os.path.basename(filename) + print(base) if ( not reg.fullmatch(base) and not base == '__init__.py' and