When `EPYTEST_PLUGINS` contains `${PN}`, skip it when adding
dependencies.  This avoids a self-dependency, while making it possible
to easily test pytest plugins themselves without having to append to
`EPYTEST_PLUGINS` locally.

Signed-off-by: Michał Górny <[email protected]>
---
 eclass/distutils-r1.eclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index b9366d187555..7b025261eb2b 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -565,6 +565,10 @@ distutils_enable_tests() {
                        _set_epytest_plugins
                        for plugin in "${EPYTEST_PLUGINS[@]}"; do
                                case ${plugin} in
+                                       ${PN})
+                                               # don't add a dependency on self
+                                               continue
+                                               ;;
                                        pkgcore)
                                                plugin=sys-apps/${plugin}
                                                ;;

Reply via email to