1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

test: conftest: require_programs() automatically (MR 2483)

Pmbootstrap finds all its host dependencies during init, ensure we do
that for pytest too.

Adapt require_programs() to use subprocess directly rather than have to
solve the weird dependency chain of pmb.helpers.run which depends on the
global context being initialised before it's usable.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
This commit is contained in:
Caleb Connolly 2024-11-11 22:39:35 +01:00 committed by Oliver Smith
parent cefe98fb69
commit bb12609753
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 17 additions and 4 deletions

View file

@ -52,6 +52,13 @@ def device_package(config_file):
return pkgdir
@pytest.fixture(autouse=True)
def find_required_programs():
"""Fixture to find required programs for pmbootstrap."""
pmb.config.require_programs()
@pytest.fixture
def mock_devices_find_path(device_package, monkeypatch):
"""Fixture to mock pmb.helpers.devices.find_path()"""