commit:     c2b7912f97d080fafefaa213e9e88ba6c7cc4501
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 14 15:18:19 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Mar 28 10:22:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2b7912f

distutils-r1.eclass: Use eunittest, add dep on unittest-or-fail

Switch to the new helper for running unittest-style tests.  Add a new
dependency on dev-python/unittest-or-fail.  Besides making the test
phase fail on missing tests, it also means that IUSE=test is now added
cnsistently with nose and pytest variants.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/distutils-r1.eclass | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 655a33e0d20..b8b77103c0c 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -426,6 +426,7 @@ distutils_enable_tests() {
                setup.py)
                        ;;
                unittest)
+                       test_pkg="dev-python/unittest-or-fail"
                        ;;
                *)
                        die "${FUNCNAME}: unsupported argument: ${1}"
@@ -830,7 +831,7 @@ distutils-r1_python_test() {
                        nonfatal esetup.py test --verbose
                        ;;
                unittest)
-                       "${EPYTHON}" -m unittest discover -v
+                       eunittest
                        ;;
                *)
                        die "Mis-synced test runner between ${FUNCNAME} and 
distutils_enable_testing"

Reply via email to