We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f669379 commit 0e93be0Copy full SHA for 0e93be0
1 file changed
pre_commit_hooks/tests_should_end_in_test.py
@@ -14,8 +14,8 @@ def main(argv: Sequence[str] | None = None) -> int:
14
'--pytest',
15
dest='pattern',
16
action='store_const',
17
- const=r'.*/tests_*\.py',
18
- default=r'.*/tests_*\.py',
+ const=r'tests/.*/tests_*\.py',
+ default=r'tests/.*/tests_*\.py',
19
help='(the default) ensure tests match %(const)s',
20
)
21
args = parser.parse_args(argv)
@@ -27,9 +27,10 @@ def main(argv: Sequence[str] | None = None) -> int:
27
print(base)
28
if (
29
not reg.fullmatch(base) and
30
- not base == '__init__.py' and
31
- not base == 'conftest.py' and
32
- not base == 'models.py'
+ not base == '.*/__init__.py' and
+ not base == '.*/conftest.py' and
+ not base == '.*/models.py'
33
+
34
):
35
retcode = 1
36
print(f'{filename} does not match pattern "{args.pattern}"')
0 commit comments