add exclude pattern to test names hook

This commit is contained in:
Ahmed Taweel 2019-02-06 09:27:19 +02:00
parent 634383cffd
commit a977384397
3 changed files with 22 additions and 0 deletions

View file

@ -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