-
Notifications
You must be signed in to change notification settings - Fork 149
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
Update documentation for Running tests
#570
Conversation
- use Python 3.9 instead of unsupported Python 2.7 - update `tox` command to enable running a single test Previously, all tests were selected and coverage ran, which makes no sense if you only run one test.
@@ -19,7 +19,7 @@ deps = | |||
install_command = pip install --pre {opts} {packages} | |||
commands = | |||
python --version | |||
py.test {posargs} | |||
pytest {posargs} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is unrelated. Though, pytest dropped the dot a couple of years ago.
@@ -5,7 +5,7 @@ skip_missing_interpreters = True | |||
[testenv] | |||
commands = | |||
python --version | |||
pytest tests --cov-report term-missing --cov-fail-under 100 --cov cornice {posargs} | |||
pytest {posargs: --cov-report term-missing --cov-fail-under 100 --cov cornice} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything behind posargs:
is the default value which can be overridden - this is necessary to be able to select a single test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oH I had no idea of this, thanks!
or:: | ||
|
||
tox -e py27 tests.test_validation:TestServiceDefinition.test_content_type_missing | ||
tox -e py39 tests/test_validation.py::TestServiceDefinition::test_content_type_missing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was only able to make this variant to run. Also most people possibly prefer to use -k
to filter the tests.
@@ -5,7 +5,7 @@ skip_missing_interpreters = True | |||
[testenv] | |||
commands = | |||
python --version | |||
pytest tests --cov-report term-missing --cov-fail-under 100 --cov cornice {posargs} | |||
pytest {posargs: --cov-report term-missing --cov-fail-under 100 --cov cornice} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oH I had no idea of this, thanks!
tox
command to enable running a single testPreviously, all tests were selected and coverage ran, which makes no
sense if you only run one test.