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 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 rrauenza commented Dec 4, 2019

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

@asottile asottile force-pushed the rrauenza:rrauenza-patch-1 branch from 69104be to 779714d Dec 4, 2019
@asottile asottile force-pushed the rrauenza:rrauenza-patch-1 branch from 779714d to 3724c8f Dec 4, 2019
Copy link
Member

@asottile asottile left a comment

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
1 check passed
1 check passed
pre-commit.pre-commit-hooks #20191204.4 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.