sys-process/glances: 3.1.4.1-r1 amd64 stable, bug #720368
[gentoo.git] / dev-python / pytest / pytest-4.5.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Simple powerful testing with Python"
11 HOMEPAGE="http://pytest.org/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="MIT"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
17 IUSE="test"
18 RESTRICT="!test? ( test )"
19
20 # When bumping, please check setup.py for the proper py version
21 PY_VER="1.5.0"
22
23 # pathlib2 has been added to stdlib before py3.6, but pytest needs __fspath__
24 # support, which only came in py3.6.
25 RDEPEND="
26         >=dev-python/atomicwrites-1.0[${PYTHON_USEDEP}]
27         >=dev-python/attrs-17.4.0[${PYTHON_USEDEP}]
28         >=dev-python/more-itertools-4.0.0[${PYTHON_USEDEP}]
29         $(python_gen_cond_dep '
30                 dev-python/pathlib2[${PYTHON_USEDEP}]
31                 dev-python/funcsigs[${PYTHON_USEDEP}]
32         ' -2)
33         >=dev-python/pluggy-0.11[${PYTHON_USEDEP}]
34         <dev-python/pluggy-1
35         >=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]
36         >=dev-python/setuptools-40[${PYTHON_USEDEP}]
37         dev-python/six[${PYTHON_USEDEP}]
38         dev-python/wcwidth[${PYTHON_USEDEP}]"
39
40 # flake cause a number of tests to fail
41 DEPEND="${RDEPEND}
42         test? (
43                 >=dev-python/hypothesis-3.56[${PYTHON_USEDEP}]
44                 dev-python/nose[${PYTHON_USEDEP}]
45                 $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' -2)
46                 dev-python/requests[${PYTHON_USEDEP}]
47                 !!dev-python/flaky
48         )"
49
50 PATCHES=(
51         "${FILESDIR}/${PN}-4.5.0-strip-setuptools_scm.patch"
52 )
53
54 python_prepare_all() {
55         grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
56
57         # Something in the ebuild environment causes this to hang/error.
58         # https://bugs.gentoo.org/598442
59         rm testing/test_pdb.py || die
60
61         distutils-r1_python_prepare_all
62 }
63
64 python_test() {
65         # In v4.1.1, pytest started being picky about its own verbosity options.
66         # running pytest on itself with -vv made 3 tests fail. This is why we don't
67         # have it below.
68         "${EPYTHON}" "${BUILD_DIR}"/lib/pytest.py --lsof -rfsxX \
69                 || die "tests failed with ${EPYTHON}"
70 }