diff --git a/meta/conf/distro/include/ptest-packagelists.inc b/meta/conf/distro/include/ptest-packagelists.inc
index bef45bb4d5..77e03b33b1 100644
--- a/meta/conf/distro/include/ptest-packagelists.inc
+++ b/meta/conf/distro/include/ptest-packagelists.inc
@@ -93,6 +93,7 @@ PTESTS_FAST = "\
     python3-pluggy \
     python3-pefile \
     python3-pyasn1 \
+    python3-pygobject \
     python3-pyopenssl \
     python3-pyyaml \
     python3-rpds-py \
diff --git a/meta/recipes-devtools/python/python3-pygobject/run-ptest b/meta/recipes-devtools/python/python3-pygobject/run-ptest
new file mode 100755
index 0000000000..47fab21c9c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pygobject/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+export LD_LIBRARY_PATH=$PWD/../gi-tests
+export GI_TYPELIB_PATH=$PWD/../gi-tests
+export GSETTINGS_SCHEMA_DIR=$PWD/tests
+export GSETTINGS_BACKEND=memory
+
+pytest --automake
diff --git a/meta/recipes-devtools/python/python3-pygobject_3.58.1.bb b/meta/recipes-devtools/python/python3-pygobject_3.58.1.bb
index 82089c2ad7..069a313735 100644
--- a/meta/recipes-devtools/python/python3-pygobject_3.58.1.bb
+++ b/meta/recipes-devtools/python/python3-pygobject_3.58.1.bb
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=91db794c3adc9d824d4eddabb341e816"
 
 GIR_MESON_OPTION = ""
 
-inherit gnomebase setuptools3-base gobject-introspection upstream-version-is-even
+inherit gnomebase setuptools3-base gobject-introspection upstream-version-is-even ptest-python-pytest
 
 python() {
     if d.getVar('CLASSOVERRIDE') == "class-target" and not bb.utils.to_boolean(d.getVar("GI_DATA_ENABLED")):
@@ -19,11 +19,13 @@ DEPENDS += "python3 glib-2.0"
 GNOME_COMPRESS_TYPE = "gz"
 GNOMEBN = "pygobject"
 
+SRC_URI += "file://run-ptest"
 SRC_URI[archive.sha256sum] = "4c80598ade17fbaa7798e01a25d0bf29ce109740786026a074c5c62bb3e79d23"
 
 S = "${UNPACKDIR}/${GNOMEBN}-${PV}"
 
-PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)}"
+PACKAGECONFIG ??= "${@bb.utils.contains_any('DISTRO_FEATURES', [ 'directfb', 'wayland', 'x11' ], 'cairo', '', d)} \
+                   ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
 
 RDEPENDS:${PN} += " \
     python3-asyncio \
@@ -35,7 +37,26 @@ RDEPENDS:${PN} += " \
 # python3-pycairo is checked on configuration -> DEPENDS
 # we don't link against python3-pycairo -> RDEPENDS
 PACKAGECONFIG[cairo] = "-Dpycairo=enabled,-Dpycairo=disabled, cairo python3-pycairo, python3-pycairo"
-PACKAGECONFIG[tests] = "-Dtests=true,-Dtests=false,"
+# do_install_ptest_base cleans PTEST_PATH, so the test libraries go next to it
+PACKAGECONFIG[tests] = "-Dtests=true -Dgobject-introspection-tests:install_dir=${libdir}/${BPN}/gi-tests,-Dtests=false,"
+
+do_install_ptest:append() {
+    rm -f ${D}${PTEST_PATH}/tests/*.c ${D}${PTEST_PATH}/tests/*.h ${D}${PTEST_PATH}/tests/meson.build
+    install -m 0644 ${S}/pyproject.toml ${D}${PTEST_PATH}/
+    install -m 0644 ${B}/tests/gschemas.compiled ${D}${PTEST_PATH}/tests/
+    install -m 0755 ${B}/tests/testhelper*.so ${D}${PTEST_PATH}/tests/
+}
+
+FILES:${PN}-ptest += "${libdir}/${BPN}/gi-tests"
+
+RDEPENDS:${PN}-ptest += " \
+    bash \
+    python3-ctypes \
+    python3-misc \
+    python3-pickle \
+    python3-unittest \
+"
+RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-iso8859-1"
 
 BBCLASSEXTEND = "native"
 PACKAGECONFIG:class-native = ""
