Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix regular expression for test files #429

Merged
merged 2 commits into from
Dec 4, 2019

Conversation

rrauenza
Copy link
Contributor

@rrauenza rrauenza commented Dec 4, 2019

Noticed this when reading the code -- the regular expression doesn't escape the . in the .py

@asottile
Copy link
Member

asottile commented Dec 4, 2019

thanks for the fix! mind adding a quick test? should be easy to show with like foo_py

@rrauenza
Copy link
Contributor Author

rrauenza commented Dec 4, 2019

Ok, submitted one. I cheated for the first fix and just did it in github's online editor :)

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed up the test and made sure it failed first (had to adjust the filename slightly):

$ pytest tests/tests_should_end_in_test_test.py
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.3.1, py-1.8.0, pluggy-0.13.1
rootdir: /tmp/pre-commit-hooks
collected 8 items                                                              

tests/tests_should_end_in_test_test.py ..F.....                          [100%]

=================================== FAILURES ===================================
__________________________________ test_regex __________________________________

    def test_regex():
>       assert main(('foo_test_py',)) == 1
E       AssertionError: assert 0 == 1
E        +  where 0 = main(('foo_test_py',))

tests/tests_should_end_in_test_test.py:15: AssertionError
========================= 1 failed, 7 passed in 0.03s ==========================

@asottile asottile merged commit 5df1a4b into pre-commit:master Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants