-
Notifications
You must be signed in to change notification settings - Fork 8
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 PytestDeprecationWarning #7
Comments
Thanks for the report! I'm not using this plugin myself anymore, so I likely won't have the time to look into this - a PR would be much appreciated though! |
Do you use anything else which goes in a similar direction? |
@MartinThoma I run linting steps (such as mccabe) via flake8, and then run both pytest and flake8 (as well as others, such as pylint or mypy) via tox. IMHO, it's a bad idea to run linters via pytest as running a linter and running tests are two different kind of things - though I only realized that after writing this plugin. |
It's a pretty good idea to run linters from pytest when there is a supported pytest plugin. If works well for so many linters, just not this one. This plugin is useless and a new one is needed. |
@impredicative Or, you know, you could contribute a fix (as I mentioned above) rather than complaining and I'd gladly review/merge PRs and cut a new release. Things like this is what drives open source maintainers to burnout. Nobody owes you anything in their free time - either take it, improve it, or go use something else. |
@impredicative you can run also McCabe in pytest with https://pypi.org/project/pytest-flake8/ |
What is the disadvantage of running them both (test + linters) via pytest? I find it very handy to be able to do so. Usually, before I push stuff I run most things locally via pytest. I like to have one command to do it all. |
Just to clarify this again: I don't have a strict opinion on this - what I wrote above is based on my personal experience (mainly with my main project, qutebrowser) and happened back in 2015 (some of it before e.g. pytest-flake8 existed). If you're happy with running linters from pytest and it works out for you, I don't see an important reason to stop doing so. Since I don't really remember the details on why I switched, I went digging into the qutebrowser repository a bit. I started with a custom script calling flake8 in January 2014, then switched to running linters via pytest in June 2015, and back to flake8 in January 2016. From the top of my head, here are some thoughts about things which might or might not be an issue. Many of those wouldn't apply to pytest-flake8 I guess, just to the plugins calling linters directly:
Long story short: If you're using pytest-flake8 and that works for you, by all means, go ahead! If you're using
FWIW that's the vision of tox: You clone a Python project (even one you've never used before), see a Compare this to using e.g. pytest-flake8 (or pytest-mccabe for that matter): A new contributor to your project will need to set up a virtualenv, find out what test runner you're using (granted, pytest is pretty common nowadays), find out what plugins they need to install to run the tests (hopefully there's a Additionally, tox still allows you to clearly separate the two environments, if needed. If you just want to run flake8 without your tests, all it takes is a (Again, that's all my personal take on it - if you have a different opinion, that's completely fine!) |
Wow, thank you so much for taking the time! I didn't know that flake8 also has plugins. Some notes which others might like as well:
|
Thanks to @MartinThoma in #8, this is now fixed and I just released pytest-mccabe 2.0 with the fix. It also drops support for older pytest/Python versions, see the README for a changelog. |
Thank you for this invaluable package. Lately I see this message:
Please see this similar issue with comments providing additional info.
The text was updated successfully, but these errors were encountered: