diff mbox series

[meta-python,3/5] python3-screeninfo: Enable tests

Message ID 20260709130921.4185087-3-leon.anavi@konsulko.com
State Under Review
Headers show
Series [meta-python,1/5] python3-jsbeautifier: Enable tests | expand

Commit Message

Leon Anavi July 9, 2026, 1:09 p.m. UTC
Inherit ptest and include tests for screeninfo.

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 .../python/python3-screeninfo/run-ptest       |  3 +++
 .../python/python3-screeninfo_0.8.1.bb        | 23 +++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-screeninfo/run-ptest
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-screeninfo/run-ptest b/meta-python/recipes-devtools/python/python3-screeninfo/run-ptest
new file mode 100644
index 0000000000..8d2017d39c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-screeninfo/run-ptest
@@ -0,0 +1,3 @@ 
+#!/bin/sh
+
+pytest --automake
diff --git a/meta-python/recipes-devtools/python/python3-screeninfo_0.8.1.bb b/meta-python/recipes-devtools/python/python3-screeninfo_0.8.1.bb
index a7a20707ef..4e1da84c66 100644
--- a/meta-python/recipes-devtools/python/python3-screeninfo_0.8.1.bb
+++ b/meta-python/recipes-devtools/python/python3-screeninfo_0.8.1.bb
@@ -4,11 +4,30 @@  SECTION = "devel/python"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE.md;md5=a23813181e06852d377bc25ae5563a97"
 
-SRC_URI[sha256sum] = "9983076bcc7e34402a1a9e4d7dabf3729411fd2abb3f3b4be7eba73519cd2ed1"
+# The PyPI package omits files for testing
+# so use the GitHub source instead.
+SRCREV = "0cf3055ccaf583a00a7a3a049f85a7c58dfd8884"
+SRC_URI = " \
+    git://github.com/rr-/screeninfo;branch=master;protocol=https \
+    file://run-ptest \
+"
 
-inherit pypi python_poetry_core
+inherit python_poetry_core ptest
 
 RDEPENDS:${PN} += "\
     python3-core \
     python3-profile \
 "
+
+RDEPENDS:${PN}-ptest += " \
+    python3-pytest \
+    python3-core \
+    python3-unittest \
+    python3-unittest-automake-output \
+"
+
+do_install_ptest() {
+    install -d ${D}${PTEST_PATH}/tests
+    cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
+    cp -f ${S}/README.md ${D}${PTEST_PATH}/
+}