mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-06 12:06:53 +00:00
add exclude pattern to test names hook
This commit is contained in:
parent
634383cffd
commit
a977384397
3 changed files with 22 additions and 0 deletions
|
|
@ -34,3 +34,18 @@ def test_main_not_django_fails():
|
|||
def test_main_django_fails():
|
||||
ret = main(['--django', 'foo_test.py', 'test_bar.py', 'test_baz.py'])
|
||||
assert ret == 1
|
||||
|
||||
|
||||
def test_exclude_default_factory_files():
|
||||
ret = main(['--django', 'test_bar.py', 'test_baz.py', 'factory.py', 'factories.py'])
|
||||
assert ret == 0
|
||||
|
||||
|
||||
def test_exclude_custom_files_files():
|
||||
ret = main(['--django', '--exclude=tty.*.py', 'test_bar.py', 'test_baz.py', 'tty124.py', 'tty_file.py'])
|
||||
assert ret == 0
|
||||
|
||||
|
||||
def test_exclude_no_match_files():
|
||||
ret = main(['--django', 'test_bar.py', 'test_baz.py', 'tty_file.py'])
|
||||
assert ret == 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue