diff options
| -rw-r--r-- | meta/lib/oeqa/sdk/cases/maturin.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/meta/lib/oeqa/sdk/cases/maturin.py b/meta/lib/oeqa/sdk/cases/maturin.py index 42394c7a97..83d13c4ec5 100644 --- a/meta/lib/oeqa/sdk/cases/maturin.py +++ b/meta/lib/oeqa/sdk/cases/maturin.py | |||
| @@ -19,17 +19,15 @@ class MaturinTest(OESDKTestCase): | |||
| 19 | self.ensure_host_package("python3-maturin") | 19 | self.ensure_host_package("python3-maturin") |
| 20 | 20 | ||
| 21 | def test_maturin_list_python(self): | 21 | def test_maturin_list_python(self): |
| 22 | py_major = self._run("python3 -c 'import sys; print(sys.version_info.major)'") | 22 | out = self._run(r"""python3 -c 'import sys; print(f"{sys.executable}\n{sys.version_info.major}.{sys.version_info.minor}")'""") |
| 23 | py_minor = self._run("python3 -c 'import sys; print(sys.version_info.minor)'") | 23 | executable, version = out.splitlines() |
| 24 | python_version = "%s.%s" % (py_major.strip(), py_minor.strip()) | ||
| 25 | cmd = "maturin list-python" | ||
| 26 | output = self._run(cmd) | ||
| 27 | self.assertRegex(output, r"^🐍 1 python interpreter found:\n") | ||
| 28 | self.assertRegex( | ||
| 29 | output, | ||
| 30 | r" - CPython %s (.+)/usr/bin/python%s$" % (python_version, python_version), | ||
| 31 | ) | ||
| 32 | 24 | ||
| 25 | output = self._run("maturin list-python") | ||
| 26 | # The output looks like this: | ||
| 27 | # - CPython 3.13 at /usr/bin/python3 | ||
| 28 | # We don't want to assume CPython so just check for the version and path. | ||
| 29 | expected = f"{version} at {executable}" | ||
| 30 | self.assertIn(expected, output) | ||
| 33 | 31 | ||
| 34 | class MaturinDevelopTest(OESDKTestCase): | 32 | class MaturinDevelopTest(OESDKTestCase): |
| 35 | @classmethod | 33 | @classmethod |
