Why not just use `mypy`and "pytest`? What are the advantages of the "pytest-mypy" package?
See original GitHub issueSorry for my noob question, but what is the purpose of the package? I can run in a terminal locally or at a cloud’s CI/CD the following two commands:
> mypy src/ && mypy tests/
> pytest tests/
So why waste time on a new package development instead of just running two simple commands?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Why not just use mypy and "pytest`? What are the advantages ...
I made a conclusion that pytest-mypy is a kind of alternative without any significant difference and without any valuable advantages.
Read more >Why Use Pytest to Test Your Software Project? - Medium
Among its many advantages are that it's easy to write, supports unittest, runs in parallel, and reduces code duplication. Read on to find...
Read more >pytest-mypy - Bountysource
Why not just use `mypy`and "pytest`? What are the advantages of the "pytest-mypy" package? $ 0. Created 1 year ago in dbader/pytest-mypy ......
Read more >Ultimate Python Tox Guide with Practical Examples with MyPy ...
This tutorial will teach you the follwoing. What is tox and why you should use it? How you can add unit tests with...
Read more >Effective Python Testing With Pytest
Testing your code brings a wide variety of benefits. It increases your confidence that the code behaves as you expect and ensures that ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I use this plugin, and a few more for my favourite linters, to run all the checks in a single command as @dmtucker described.
This has several advantages:
I do actually use this for projects that support a range of Python versions; I just run pytest with all the plugins in an appropriate container on the CI. The checks are fast anyway, so it’s no big deal. It’s true that I should get rid of that setup and move to tox though, I just haven’t got a sufficiently round tuit yet 😃.
So thanks to @dmtucker and @dbader and the other contributors for this useful tool!
Maybe we could consider this issue a request for adding a few lines on “What is this for?” to the README?
FWIW, PyCharm doesn’t provide a
mypy
Run Configuration, but it does provide apytest
one.Furthermore, it doesn’t have a Run Configuration to run some arbitrary executable or script in an arbitrary way without limitations or strange peculiarities. It does have a
Shell Script
Run Configuration that can indeed be abused to do that, however, that’s not the intent of that.Therefore, this module can be a simple way to integrate an explicit
mypy
run (as opposed to another real-time background inspection) with PyCharm.