dev-python/hyper-h2: Enable tests
authorMichał Górny <mgorny@gentoo.org>
Sun, 15 Jul 2018 06:43:22 +0000 (08:43 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 15 Jul 2018 08:37:50 +0000 (10:37 +0200)
dev-python/hyper-h2/hyper-h2-3.0.1.ebuild

index 9bf1fd6ffd196c1cfc3e365386b2d2aefddb51d8..0c67c2fa3c2a4664eddfb8ceda5cb85942fc4d0a 100644 (file)
@@ -13,7 +13,8 @@ SRC_URI="https://github.com/python-hyper/${PN}/archive/v${PV}.tar.gz -> ${P}.tar
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd"
-IUSE=""
+IUSE="test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
        >=dev-python/hyperframe-5.0.0[${PYTHON_USEDEP}]
@@ -24,4 +25,12 @@ RDEPEND="
        $(python_gen_cond_dep '<dev-python/enum34-2.0.0[${PYTHON_USEDEP}]' python2_7)
 "
 DEPEND="${RDEPEND}
+       test? (
+               dev-python/hypothesis[${PYTHON_USEDEP}]
+               dev-python/pytest[${PYTHON_USEDEP}]
+       )
 "
+
+python_test() {
+       pytest -vv test || die "Tests fail with ${EPYTHON}"
+}