Fixed #2127 - WPS000 on several code fragments (Fragment 1)#2131
Conversation
|
This is my first ever pull request, so please let me know if I'm doing something wrong. I identified the cause of the first fragment of issue #2127 and proposed a solution. I tried creating a regression test, but not sure I did it correctly. Any advice or somewhere I can look at documentation would be appreciated! |
sobolevn
left a comment
There was a problem hiding this comment.
You are doing great! Congrats on your first PR 🎉
Now CI will suggest some small nitpicks to fix before your PR can be merged, please, address the highlighted issues. And I will be happy to merge it!
|
You can also run |
|
Thanks @sobolevn! I appreciate it. I think I fixed all the highlighted issues. |
|
Thanks, so much @sobolevn. Is there anything else I need to do on my end for this issue? |
|
Yes, there are three failing tests. We need to figure out what to do with them. |
|
|
||
|
|
||
| def test_regression2127( | ||
| assert_errors, |
There was a problem hiding this comment.
It looks like the test is failing here. assert_errors is not a part of the pytest --fixtures list. But looking at other tests, it looks like that is used to assert whether any errors are occurring on a visitor. I tired to use the same method here, but it seems like it can't find assert_errors. Any idea what I'm missing here?
There was a problem hiding this comment.
Yes, assert_errors is defined in tests/test_visitors.py: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/test_visitors/conftest.py#L20
Move your tests into tests/test_visitors subfolder and it should be fine! 👍
|
@sobolevn Sorry to keep bothering you, but I can't seem to figure out what's going wrong with the test. I tried a few different things, but nothing seems to be working. It looks like the issue is in the test_no_qa.py file. Any insight on where I should investigate as to why the tests are failing? |
|
Hey! There are also style issues: Let's fix them first, so we can actually see failing tests output. |
|
Apologies. I fixed the style issues and ran flake8 and mypy locally with no issues, so hopefully that gets all of the style issues. |
|
Looks like this error is not triggered: https://github.com/wemake-services/wemake-python-styleguide/blob/master/tests/fixtures/noqa/noqa.py#L614-L618 |
|
Thanks for that @sobolevn. That was super helpful in terms of helping me understand what was going on. I think I fixed the issue and passed all tests this time around. |
Codecov Report
@@ Coverage Diff @@
## master #2131 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 118 118
Lines 6207 6213 +6
Branches 1379 1379
=========================================
+ Hits 6207 6213 +6
Continue to review full report at Codecov.
|
|
@danielboghean thanks again! 👍 |
I have made things!
Checklist
CHANGELOG.mdRelated issues
🙏 Please, if you or your company is finding wemake-python-styleguide valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/wemake-python-styleguide. As a thank you, your profile/company logo will be added to our main README which receives hundreds of unique visitors per day.