From 8215312c10985bd9304f432984ad7c8399d5eb44 Mon Sep 17 00:00:00 2001 From: Uros <115799310+KatanicU@users.noreply.github.com> Date: Thu, 17 Oct 2024 16:29:14 +0200 Subject: [PATCH] add new regex --- pre_commit_hooks/tests_should_end_in_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pre_commit_hooks/tests_should_end_in_test.py b/pre_commit_hooks/tests_should_end_in_test.py index 483aaac..326e273 100644 --- a/pre_commit_hooks/tests_should_end_in_test.py +++ b/pre_commit_hooks/tests_should_end_in_test.py @@ -14,8 +14,8 @@ def main(argv: Sequence[str] | None = None) -> int: '--pytest', dest='pattern', action='store_const', - const=r'tests/.*/tests_*\.py', - default=r'tests/.*/tests_*\.py', + const=r'^tests\/(?:[a-zA-Z0-9_]+\/)*tests[a-zA-Z0-9_]*\.py$', + default=r'^tests\/(?:[a-zA-Z0-9_]+\/)*tests[a-zA-Z0-9_]*\.py$', help='(the default) ensure tests match %(const)s', ) args = parser.parse_args(argv)