theY4Kman / pytest-only

pytest plug-in to run single tests with the "only" mark (perfect for use with auto-rerunners!)
https://pypi.org/project/pytest-only/
MIT License
18 stars 5 forks source link

Add pylint checker rule #10

Closed nikolaik closed 2 years ago

nikolaik commented 2 years ago

We found it useful to lint usage of this pytest marker and maybe others do too.

nikolaik commented 2 years ago

Nice, will update with your suggestions. i'll try to add a test too

nikolaik commented 2 years ago

Neat trick with the live template in pycharm, never tried those 💡

theY4Kman commented 2 years ago

I pushed a bunch of stuff to your branch. It always feels a little weird pushing to someone else's repo :P But it sure is convenient, and it doesn't ditch the commit author field (like pulling it into my own branch and merging straight to master/opening a separate PR might).

Anywhoozlewoozle, I did the restructuring to pytest_only.ext.pylint, added a bunch of tests (using pytest-pylint), and also realized @pytest.mark.only on a function isn't the only way to apply marks, so I added support for class-level decorators and pytestmark = ... at class/module levels. I also added support for async function defs, just in case anyone uses it with pytest-asyncio et al (like moi).

I'd really like to know if the changes I made still work in your env before I merge, though.

nikolaik commented 2 years ago

Most excellent! Will test your changes tomorrow!

nikolaik commented 2 years ago

Very nice, works just as expected, bravo! Minus the comment on python version dependency resolution

nikolaik commented 2 years ago

@theY4Kman if you want me to test anything else, let me know!

theY4Kman commented 2 years ago

Agh, sorry, I got married this weekend, and things have been hectic. That's my excuse :P I'll revisit this later tonight, and get it all released.

theY4Kman commented 2 years ago

Thanks for that version constraint fix. I wish I knew how to include that installation path in the tests; right now, it's using poetry to install all deps, then uses pip to override whatever version of pytest it installed =/

Also, thank you so much for taking the time to open the pull request, and for thinking about other peeps who'll find this very handy :) Aaaand sorry for the delay in merging :P

nikolaik commented 2 years ago

Wowza, congrats @theY4Kman and cheers to you both 🥂