Skip to content
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

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

jugmac00
Copy link
Contributor

  • 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.

- 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}
Copy link
Contributor Author

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}
Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Contributor Author

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}
Copy link
Contributor

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!

@leplatrem leplatrem merged commit 15dfca9 into Cornices:master Jan 25, 2022
@jugmac00 jugmac00 deleted the update-running-tests branch January 25, 2022 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants