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
commit 5df1a4bf6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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',