summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-03-14 16:05:30 +0100
committerMichał Górny <mgorny@gentoo.org>2021-03-14 16:20:55 +0100
commit904dacc249f7ed33376457c5f65b93a7b384dd7b (patch)
treefe4154f33fca60e4a86181cdc071bdda7656cad4 /dev-python/unittest-or-fail
parentgnome-extra/pch-session: amd64 stable (diff)
downloadgentoo-904dacc249f7ed33376457c5f65b93a7b384dd7b.tar.gz
gentoo-904dacc249f7ed33376457c5f65b93a7b384dd7b.tar.bz2
gentoo-904dacc249f7ed33376457c5f65b93a7b384dd7b.zip
dev-python/unittest-or-fail: New package to aid running unittests
New package to ensure that src_test() will fail if unittest does not discover any tests. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/unittest-or-fail')
-rw-r--r--dev-python/unittest-or-fail/Manifest1
-rw-r--r--dev-python/unittest-or-fail/metadata.xml11
-rw-r--r--dev-python/unittest-or-fail/unittest-or-fail-0.ebuild25
3 files changed, 37 insertions, 0 deletions
diff --git a/dev-python/unittest-or-fail/Manifest b/dev-python/unittest-or-fail/Manifest
new file mode 100644
index 00000000000..8ce67bb37ef
--- /dev/null
+++ b/dev-python/unittest-or-fail/Manifest
@@ -0,0 +1 @@
+DIST unittest-or-fail-0.tar.gz 2445 BLAKE2B 42d97fb3bd7e825ecf521ebbb435ca3973f83e107d86848f2c03d6d2321c9b87ec68db159e658bd5eead5321b7085ecec5350947818f55141eb18eb72719e2ad SHA512 8df21f5e235e03f4b5a8ae351420ac667612afddeb52a27bb2d4812bedbea87ba857dedfa37001a72872529b7c1984d15ddda93edfa6f989f0990b72c4b57baf
diff --git a/dev-python/unittest-or-fail/metadata.xml b/dev-python/unittest-or-fail/metadata.xml
new file mode 100644
index 00000000000..22e0d6d87f6
--- /dev/null
+++ b/dev-python/unittest-or-fail/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/dev-python/unittest-or-fail/unittest-or-fail-0.ebuild b/dev-python/unittest-or-fail/unittest-or-fail-0.ebuild
new file mode 100644
index 00000000000..71a06e180e2
--- /dev/null
+++ b/dev-python/unittest-or-fail/unittest-or-fail-0.ebuild
@@ -0,0 +1,25 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_USE_SETUPTOOLS=no
+PYTHON_COMPAT=( python3_{7..9} pypy3 )
+inherit distutils-r1
+
+DESCRIPTION="Run unittests or fail if no tests were found"
+HOMEPAGE="https://github.com/mgorny/unittest-or-fail/"
+SRC_URI="
+ https://github.com/mgorny/unittest-or-fail/archive/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+# Warning: do not use distutils_enable_tests to avoid a circular
+# dependency on itself!
+python_test() {
+ "${EPYTHON}" -m unittest -v test/test_unittest_or_fail.py ||
+ die "Tests failed with ${EPYTHON}"
+}