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

README.rst: add pytest examples and mention tox limitations #682

Merged
merged 2 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,23 @@ Then, run the test suite locally from the top level directory::

tox

You can use ``--`` to tell tox to pass arguments to ``pytest``. This is
especially useful to focus on specific tests and save time. Examples::

# Run a subset of tests
tox -- tests/test_project.py

# Debug the ``test_update_narrow()`` code with ``pdb`` (but _not_ the
# west code which is running in subprocesses)
tox -- --verbose --exitfirst --trace -k test_update_narrow

# Run all tests with "import" in their name and let them log to the
# current terminal
tox -- -v -k import --capture=no

The tests cannot be run with ``pytest`` directly, they require the tox
environment.

See the tox configuration file, tox.ini, for more details.

Hacking on West
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ deps =
setenv =
TOXTEMPDIR={envtmpdir}
commands =
python -m pytest --cov=west {posargs:tests}
python -m flake8 --config={toxinidir}/tox.ini {toxinidir}
python -m mypy --config-file={toxinidir}/tox.ini --package=west
python -m pytest --cov=west {posargs:tests}
Loading