Merge pull request #429 from rrauenza/rrauenza-patch-1

fix regular expression for test files
This commit is contained in:
Anthony Sottile
2019-12-04 15:17:18 -08:00
committed by GitHub
2 changed files with 5 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ def main(argv=None): # type: (Optional[Sequence[str]]) -> int
args = parser.parse_args(argv)
retcode = 0
test_name_pattern = 'test.*.py' if args.django else '.*_test.py'
test_name_pattern = r'test.*\.py' if args.django else r'.*_test\.py'
for filename in args.filenames:
base = os.path.basename(filename)
if (

View File

@@ -11,6 +11,10 @@ def test_main_one_fails():
assert ret == 1
def test_regex():
assert main(('foo_test_py',)) == 1
def test_main_django_all_pass():
ret = main((
'--django', 'tests.py', 'test_foo.py', 'test_bar.py',