You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Developer docs on running tests should focus on pytest #3399
Our type-checking unit tests all run under pytest, and some others run under myunit.
For doing development, one generally pretty quickly wants to start running individual tests, or passing flags like py.test --verbose, -s, or -x/--exitfirst. That means running py.test directly, or running myunit directly for those tests that are under myunit. (There is a way to wrap them to send through runtests.py, but that's more complicated.)
Currently the mention in test-data/unit/README.md of running pytest directly is short and easy to gloss over. We should make it more of a focus.
Also, pytest seems to be preferred over py.test these days
TIL! I didn't even know you could say pytest as a command line.
For me it's actually a little slower / more annoying to test -- pyte<TAB> vs py.<TAB>. But I definitely appreciate having just one name to say rather than two slightly different names that apply in different contexts.
Activity
JukkaL commentedon May 22, 2017
Other things that would be worth mentioning prominently:
pytest -k SUBSTRINGto narrow down which tests to runpytest -n0 -k ...to run sequentially (can be much faster when running only a few tests)Also,
pytestseems to be preferred overpy.testthese days (https://stackoverflow.com/questions/39495429/py-test-vs-pytest-command) and it's a little faster to type as a bonus.gnprice commentedon May 22, 2017
TIL! I didn't even know you could say
pytestas a command line.For me it's actually a little slower / more annoying to test --
pyte<TAB>vspy.<TAB>. But I definitely appreciate having just one name to say rather than two slightly different names that apply in different contexts.hauntsaninja commentedon Aug 7, 2020
This issue is very old and https://github.com/python/mypy/blob/master/test-data/unit/README.md seems to currently covers these, so closing. But documentation can always be improved, so would look at a PR :-)