Skip to content

Conversation

@thorsten-klein
Copy link
Owner

No description provided.

thorsten-klein and others added 5 commits October 27, 2025 20:08
The previous test setup used subprocess calls, which did not allow to
debug the tests. It also caused a mix of Python modules from the
installed West package and the local source tree when running tests
directly with `pytest`.

The tests have been updated so that `pytest` can now be run directly and
fully debugged. `pytest` can be run as follows:
- `pytest` — runs tests against the installed package
- `pytest -o pythonpath=src` — runs tests against the local source tree

Within the tests following methods can be used to run west commands:
- cmd(...): call main() with given west command and capture std (and
optionally stderr)
- cmd_raises(...): call main() with given west command and catch
expected exception. The exception and stderr are returned by default.
Optionally stdout can be captured.
- cmd_subprocess(...): Run west command in a subprocess and capture
stdout.
When west/app/main.py is executed directly, also the correct West
modules must be imported. Therefore, the Python module search path is
configured appropriately before importing any West modules.
Test that the Python module search path is prepended with correct local
module path if west/app/main.py is executed directly.
Add support for a new 'import-modifications' section in the manifest.

Under the 'url-replace' key, users can define search-and-replace
patterns that are applied to project URLs during manifest import.
This allows downstream projects to modify remote URLs, e.g. when using
mirrored repositories.
Test that import-modifications feature works to override west project
urls that directly specified in west manifest or imported via
submanifests.
@marc-hb

This comment was marked as duplicate.

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.

3 participants