python3-pint: fix ptests
PATCH 1/1 python3-pint: fix ptests
1. Add missing ptest dependency (pytest-subtest)
2. The testsuite is installed in both the site-packages and ${PTEST_PATH} folders, however some dependencies are only available in the site-packages folder, so many test cases fail.
At this point of the branch lifecycle I decided not to refactor the recipe, but rather to just use the installation in the site-packages dir to run the tests (switch to that folder in the run-ptest script)
3. Fix the run-ptest script to output PASS/FAIL status.
--- meta-python/recipes-devtools/python/python3-pint/run-ptest | 3 ++- meta-python/recipes-devtools/python/python3-pint_0.19.1.bb | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-)
meta-python/recipes-devtools/python/python3-pint/run-ptest +2 -1
@@ -1,3 +1,4 @@ #!/bin/sh -pytest +cd /usr/lib/python3*/site-packages/pint +pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-pint_0.19.1.bb +1 -5
@@ -27,9 +27,5 @@ RDEPENDS:${PN} += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-pytest-subtests \ " - -do_install_ptest() { - install -d ${D}${PTEST_PATH}/testsuite - cp -rf ${S}/pint/testsuite/* ${D}${PTEST_PATH}/testsuite/ -}
Do we need this on master
Quoted 62 lines · Gyorgy Sarvari via lists.openembedded.org
1. Add missing ptest dependency (pytest-subtest)
2. The testsuite is installed in both the site-packages and ${PTEST_PATH} folders, however some dependencies are only available in the site-packages folder, so many test cases fail.
At this point of the branch lifecycle I decided not to refactor the recipe, but
rather to just use the installation in the site-packages dir to run the tests (switch to that folder in the run-ptest script)3. Fix the run-ptest script to output PASS/FAIL status.
Signed-off-by Gyorgy Sarvari <[email protected]>--- meta-python/recipes-devtools/python/python3-pint/run-ptest | 3 ++- meta-python/recipes-devtools/python/python3-pint_0.19.1.bb | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-)meta-python/recipes-devtools/python/python3-pint/run-ptest +2
-1@@ -1,3 +1,4 @@ #!/bin/sh -pytest +cd /usr/lib/python3*/site-packages/pint +pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'|sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-pint_0.19.1.bb +1
-6@@ -27,9 +27,5 @@ RDEPENDS:${PN} += " \ RDEPENDS:${PN}-ptest += " \ ${PYTHON_PN}-pytest \ + ${PYTHON_PN}-pytest-subtests \ " - -do_install_ptest() { - install -d ${D}${PTEST_PATH}/testsuite - cp -rf ${S}/pint/testsuite/* ${D}${PTEST_PATH}/testsuite/ -} -=-=-=-=-=-=-=-=-=-=-=-Links: You receive all messages sent to this group. View/Reply Online (#120940):
https://lists.openembedded.org/g/openembedded-devel/message/120940
Mute This Topic: https://lists.openembedded.org/mt/115918828/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
On 24 Oct 2025, at 02:12, Khem Raj <[email protected]> wrote:
Do we need this on master
Nope, master switched ptest-pytest class (which doesn't exist in master), so it works there.
On Thu, Oct 23, 2025 at 2:29 PM Gyorgy Sarvari via lists.openembedded.org <[email protected]> wrote:
1. Add missing ptest dependency (pytest-subtest)
2. The testsuite is installed in both the site-packages and ${PTEST_PATH} folders, however some dependencies are only available in the site-packages folder, so many test cases fail.
At this point of the branch lifecycle I decided not to refactor the recipe, but rather to just use the installation in the site-packages dir to run the tests (switch to that folder in the run-ptest script)
3. Fix the run-ptest script to output PASS/FAIL status.
---
meta-python/recipes-devtools/python/python3-pint/run-ptest | 3 ++- meta-python/recipes-devtools/python/python3-pint_0.19.1.bb | 6 +-----
2 files changed, 3 insertions(+), 6 deletions(-)
meta-python/recipes-devtools/python/python3-pint/run-ptest +0 -0
@@ -1,3 +1,4 @@
#!/bin/sh
-pytest
+cd /usr/lib/python3*/site-packages/pint
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta-python/recipes-devtools/python/python3-pint_0.19.1.bb +0 -0
@@ -27,9 +27,5 @@ RDEPENDS:${PN} += " \
RDEPENDS:${PN}-ptest += " \
${PYTHON_PN}-pytest \
+ ${PYTHON_PN}-pytest-subtests \
"
-
-do_install_ptest() {
- install -d ${D}${PTEST_PATH}/testsuite
- cp -rf ${S}/pint/testsuite/* ${D}${PTEST_PATH}/testsuite/
-}
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#120940): https://lists.openembedded.org/g/openembedded-devel/message/120940
Mute This Topic: https://lists.openembedded.org/mt/115918828/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-