Skip to contentSkip to conversation

python3-pytest-lazy-fixture: add recipe

PATCH New Trevor Gamblin 1 participant 2 messages Mar 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 python3-pytest-lazy-fixture: add recipe

This is a minor extension of pytest that is used by some ptests, such as python3-prettytable. There is a set of ptests included (run-ptest script is based on the one from python3-aspectlib).

---
 .../python3-pytest-lazy-fixture/run-ptest     |  3 +++
 .../python3-pytest-lazy-fixture_0.6.3.bb      | 23 +++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-pytest-lazy-fixture/run-ptest
 create mode 100644 meta-python/recipes-devtools/python/python3-pytest-lazy-fixture_0.6.3.bb
meta-python/recipes-devtools/python/python3-pytest-lazy-fixture/run-ptest new file +3 -0
new file mode 100644
index 000000000..b63c4de0d
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+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-pytest-lazy-fixture_0.6.3.bb new file +23 -0
new file mode 100644
index 000000000..32b5677f1
@@ -0,0 +1,23 @@
+# Copyright (C) 2022 Wind River Systems
+
+SUMMARY = "Use your fixtures in @pytest.mark.parametrize."
+HOMEPAGE = "https://github.com/tvorog/pytest-lazy-fixture"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=aae6f2b7c9b3ced83e0b5bb42346d4dd"
+
+SRC_URI[sha256sum] = "0e7d0c7f74ba33e6e80905e9bfd81f9d15ef9a790de97993e34213deb5ad10ac"
+
+SRC_URI += "file://run-ptest \
+           "
+
+
+inherit ptest pypi setuptools3
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+}
+
+
+RDEPENDS:${PN} += "python3-core python3-pytest"
+RDEPENDS:${PN}-ptest = " python3-unixadmin"
Signature · 1 line
2.33.0
#1 lore raw

PATCH 2/2 python3-prettytable: add python3-pytest-lazy-fixture to ptest RDEPENDS

Now that the recipe for python3-pytest-lazy-fixture exists, add it to RDEPENDS to fix the broken python3-prettytable ptests.

---
 meta-python/recipes-devtools/python/python3-prettytable_3.1.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta-python/recipes-devtools/python/python3-prettytable_3.1.1.bb +1 -0
index 3b75086fc..5520edc06 100644
@@ -35,6 +35,7 @@ RDEPENDS:${PN} += " \
 
 RDEPENDS:${PN}-ptest += " \
     ${PYTHON_PN}-pytest \
+    ${PYTHON_PN}-pytest-lazy-fixture \
     ${PYTHON_PN}-sqlite3 \
 "
 
Signature · 1 line
2.33.0