diff --git a/meta-python/conf/include/ptest-packagelists-meta-python.inc b/meta-python/conf/include/ptest-packagelists-meta-python.inc index b953ae2502..c62bfab034 100644 --- a/meta-python/conf/include/ptest-packagelists-meta-python.inc +++ b/meta-python/conf/include/ptest-packagelists-meta-python.inc @@ -72,6 +72,7 @@ PTESTS_FAST_META_PYTHON = "\ python3-pyroute2 \ python3-pyserial \ python3-pytest-mock \ + python3-pytest-sugar \ python3-pytoml \ python3-pyyaml-include \ python3-pydbus \ diff --git a/meta-python/recipes-devtools/python/python3-pytest-sugar/run-ptest b/meta-python/recipes-devtools/python/python3-pytest-sugar/run-ptest new file mode 100644 index 0000000000..b4bf4b65d8 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pytest-sugar/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +pytest -vv | 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}}' diff --git a/meta-python/recipes-devtools/python/python3-pytest-sugar_1.0.0.bb b/meta-python/recipes-devtools/python/python3-pytest-sugar_1.0.0.bb new file mode 100644 index 0000000000..9ce29aef7e --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pytest-sugar_1.0.0.bb @@ -0,0 +1,23 @@ +SUMMARY = "pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly)." +HOMEPAGE = "https://github.com/Teemu/pytest-sugar" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=dfc31f3b2a6a301239a1ba99b71a9459" + +SRC_URI += "file://run-ptest" +SRC_URI[sha256sum] = "6422e83258f5b0c04ce7c632176c7732cab5fdb909cb39cca5c9139f81276c0a" + +inherit pypi python_poetry_core ptest-python-pytest + +PACKAGECONFIG ?= "" +PACKAGECONFIG[dev] = ",,,python3-black python3-flake8 python3-pre-commit" + +do_install_ptest:append() { + install -d ${D}${PTEST_PATH}/tests + cp -rf ${S}/test_sugar.py ${D}${PTEST_PATH}/tests/ +} + +RDEPENDS:${PN} += "python3-packaging python3-pytest python3-termcolor \ + python3-core python3-packaging python3-pytest \ + python3-pytest-xdist" + +RDEPENDS:${PN}-ptest += "python3-tox"