Message ID | 20250510084400.269726-15-ross.burton@arm.com |
---|---|
State | New |
Headers | show |
Series | [01/23] buildtools-tarball: fix default_cases assignment | expand |
diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py index 42394c7a973..83d13c4ec59 100644 --- a/meta/lib/oeqa/sdk/cases/maturin.py +++ b/meta/lib/oeqa/sdk/cases/maturin.py @@ -19,17 +19,15 @@ class MaturinTest(OESDKTestCase): self.ensure_host_package("python3-maturin") def test_maturin_list_python(self): - py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'") - py_minor = self._run("python3 -c 'import sys; print(sys.version_info.minor)'") - python_version = "%s.%s" % (py_major.strip(), py_minor.strip()) - cmd = "maturin list-python" - output = self._run(cmd) - self.assertRegex(output, r"^
The test assumed that maturin would only find a single Python binary, in /usr/bin/python3*. However in eSDKs with buildtools a Python is shipped with the SDK, so the test failed. Generalise the test so that it runs python3 and obtains its path and version, and then verifies that path and and version are found by Maturin. This means we're not assuming a single Python, or the paths, or that the Python is CPython. Signed-off-by: Ross Burton <ross.burton@arm.com> --- meta/lib/oeqa/sdk/cases/maturin.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)