Skip to content

Commit 414cfa7

Browse files
authored
Merge pull request #182 from Hirevisor/master
Handling default django test filename of "tests.py"
2 parents c847dd3 + c380d0b commit 414cfa7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pre_commit_hooks/tests_should_end_in_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def validate_files(argv=None):
1616
args = parser.parse_args(argv)
1717

1818
retcode = 0
19-
test_name_pattern = 'test_.*.py' if args.django else '.*_test.py'
19+
test_name_pattern = 'test.*.py' if args.django else '.*_test.py'
2020
for filename in args.filenames:
2121
base = basename(filename)
2222
if (

tests/tests_should_end_in_test_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_validate_files_one_fails():
1212

1313

1414
def test_validate_files_django_all_pass():
15-
ret = validate_files(['--django', 'test_foo.py', 'test_bar.py', 'tests/test_baz.py'])
15+
ret = validate_files(['--django', 'tests.py', 'test_foo.py', 'test_bar.py', 'tests/test_baz.py'])
1616
assert ret == 0
1717

1818

0 commit comments

Comments
 (0)