1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 DISTUTILS_USE_SETUPTOOLS=rdepend
7 PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
11 DESCRIPTION="Simple powerful testing with Python"
12 HOMEPAGE="https://pytest.org/"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
17 KEYWORDS="~alpha ~amd64 ~arm arm64 hppa ~ia64 ~ppc ~ppc64 sparc ~x86"
19 RESTRICT="!test? ( test )"
21 # When bumping, please check setup.py for the proper py version
24 # pathlib2 has been added to stdlib before py3.6, but pytest needs __fspath__
25 # support, which only came in py3.6.
27 >=dev-python/attrs-17.4.0[${PYTHON_USEDEP}]
28 $(python_gen_cond_dep '
29 dev-python/importlib_metadata[${PYTHON_USEDEP}]
30 ' python3_{6,7} pypy3)
31 >=dev-python/more-itertools-4.0.0[${PYTHON_USEDEP}]
32 dev-python/packaging[${PYTHON_USEDEP}]
33 >=dev-python/pluggy-0.12[${PYTHON_USEDEP}]
35 >=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]
36 dev-python/six[${PYTHON_USEDEP}]
37 dev-python/wcwidth[${PYTHON_USEDEP}]"
39 # flake cause a number of tests to fail
42 >=dev-python/hypothesis-3.56[${PYTHON_USEDEP}]
43 dev-python/nose[${PYTHON_USEDEP}]
44 dev-python/mock[${PYTHON_USEDEP}]
45 dev-python/pygments[${PYTHON_USEDEP}]
46 dev-python/requests[${PYTHON_USEDEP}]
47 dev-python/xmlschema[${PYTHON_USEDEP}]
52 "${FILESDIR}/${PN}"-4.5.0-strip-setuptools_scm.patch
55 python_prepare_all() {
56 grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
58 # fragile to warnings from other packages (setuptools)
59 # little value for us to run it
60 sed -i -e 's:test_no_warnings:_&:' \
61 testing/test_meta.py || die
63 distutils-r1_python_prepare_all
67 distutils_install_for_testing
69 "${EPYTHON}" -m pytest -vv --lsof -rfsxX \
70 || die "tests failed with ${EPYTHON}"