*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pytest-mock / pytest-mock-1.6.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Thin-wrapper around the mock package for easier use with py.test"
10 HOMEPAGE="https://github.com/pytest-dev/pytest-mock/"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
16 IUSE=""
17
18 RDEPEND="dev-python/pytest[${PYTHON_USEDEP}]
19         $(python_gen_cond_dep '>=dev-python/mock-2[${PYTHON_USEDEP}]' -2)"
20 DEPEND="${RDEPEND}
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         dev-python/setuptools_scm[${PYTHON_USEDEP}]"
23
24 src_prepare() {
25         if has_version dev-python/mock; then
26                 # test fails when standalone mock is installed
27                 sed -e 's|^\(def \)\(test_standalone_mock(\)|\1_\2|' -i test_pytest_mock.py || die
28         fi
29         distutils-r1_src_prepare
30 }
31
32 python_test() {
33         local -x PYTHONPATH=${PWD}${PYTHONPATH:+:}${PYTHONPATH}
34         py.test -vv test_pytest_mock.py || die "Tests fail with ${EPYTHON}"
35 }