Closed radeklat closed 3 years ago
That's a great idea! I just added support for reading the tools.pytest.ini_options
of a pyproject.toml
file. Just configure the path to the pyproject.toml
in the settings, and you're good to go :)
I published it to the marketplace as version 0.4. It should be available in a day or two, pending JetBrains approval.
Thanks again for the suggestion!
Holy crap, they approved it in record time – only 3 hours after submitting it! It should now be available within the Plugins section.
Oh, also, I forgot to mention: in the new build, I added support for the 2021.1 EAP
@theY4Kman Thank you for the quick response, this is awesome!
@theY4Kman amazing! Thank you for implementing is so quickly :heart:
@theY4Kman, @umutseven92 and I both tried the new feature and it doesn't recognize test function names when we use the pyproject.toml
file. The file contains:
[tool.pytest.ini_options]
testpaths = "tests/unit tests/integration"
python_functions = "should_*"
but test functions starting with should_
are no longer runnable. It does work with the pytest.ini
file though.
Oof, you're quite right; that's embarrassing. The functionality worked perfectly during testing, when launching the plugin from gradle... but it definitely does not work when used from the stable channel :(
Honestly, I had no idea one could put pytest config into pyproject.toml
until y'all opened this ticket. Since I use poetry for all my personal projects (which uses pyproject.toml
), I'd love to kill an extra config file. So I want this feature just as well :P Lemme figure out what the hell is going on.
Oh my god, I'm an idiot. Of course it doesn't work. I typoed the name of the pyproject.toml
section: https://github.com/theY4Kman/pycharm-pytest-imp/blob/3a8159ab3fd8919f8a21b0a643d9ae354d09eb64/src/main/java/com/y4kstudios/pytestimp/PyTestImpService.kt#L164
I wrote
tools.pytest.ini_options
Instead of the correct
tool.pytest.ini_options
Oy gevalt.
Man, double embarrassing.
I'll push out a fix in 0.4.1 here shortly
Okay, it's been submitted
@theY4Kman Awesome, thank you for the quick response- can't wait!
Yes, my quick response of 9 days ;)
FYI: I published the plugin .zip to the 0.4.1 GitHub Release, which you can download and install manually to the IDE, if you wish to try it out sooner: https://github.com/theY4Kman/pycharm-pytest-imp/releases/download/0.4.1/pytest.imp-0.4.1.zip
In open source world, that is lightning fast :)
@theY4Kman Thanks for the fix. I agree with @umutseven92, I also consider it very fast :D I just checked and it works correctly now :) Typos happen. If I had to count the number of times I was even looking at a diff and could not spot it :roll_eyes:
pytest
support configuration frompyproject.toml
file instead ofpytest.ini
file since version 6.0. Would you please consider adding support for this file format?Many tools around Python now allow using
pyproject.toml
because there is then just one configuration file in the repository. So I think this trend will only continue and it will be more common in the future. Thank you.