mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-09 12:54:17 +00:00
Merge pull request #182 from Hirevisor/master
Handling default django test filename of "tests.py"
This commit is contained in:
commit
414cfa7b23
2 changed files with 2 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ def validate_files(argv=None):
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
retcode = 0
|
retcode = 0
|
||||||
test_name_pattern = 'test_.*.py' if args.django else '.*_test.py'
|
test_name_pattern = 'test.*.py' if args.django else '.*_test.py'
|
||||||
for filename in args.filenames:
|
for filename in args.filenames:
|
||||||
base = basename(filename)
|
base = basename(filename)
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ def test_validate_files_one_fails():
|
||||||
|
|
||||||
|
|
||||||
def test_validate_files_django_all_pass():
|
def test_validate_files_django_all_pass():
|
||||||
ret = validate_files(['--django', 'test_foo.py', 'test_bar.py', 'tests/test_baz.py'])
|
ret = validate_files(['--django', 'tests.py', 'test_foo.py', 'test_bar.py', 'tests/test_baz.py'])
|
||||||
assert ret == 0
|
assert ret == 0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue