Skip to content

Developer docs on running tests should focus on pytest #3399

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

Closed
gnprice opened this issue May 22, 2017 · 3 comments
Closed

Developer docs on running tests should focus on pytest #3399

gnprice opened this issue May 22, 2017 · 3 comments
Labels
topic-developer Issues relevant to mypy developers topic-tests topic-usability

Comments

@gnprice
Copy link
Collaborator

gnprice commented May 22, 2017

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.

@JukkaL
Copy link
Collaborator

JukkaL commented May 22, 2017

Other things that would be worth mentioning prominently:

  • pytest -k SUBSTRING to narrow down which tests to run
  • pytest -n0 -k ... to run sequentially (can be much faster when running only a few tests)

Also, pytest seems to be preferred over py.test these days (https://stackoverflow.com/questions/39495429/py-test-vs-pytest-command) and it's a little faster to type as a bonus.

@gnprice
Copy link
Collaborator Author

gnprice commented May 22, 2017

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.

@gnprice gnprice added topic-developer Issues relevant to mypy developers topic-usability labels May 22, 2017
@hauntsaninja
Copy link
Collaborator

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 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-developer Issues relevant to mypy developers topic-tests topic-usability
Projects
None yet
Development

No branches or pull requests

4 participants