1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
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"
15 KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
18 RDEPEND="dev-python/pytest[${PYTHON_USEDEP}]
19 $(python_gen_cond_dep '>=dev-python/mock-2[${PYTHON_USEDEP}]' -2)"
21 dev-python/setuptools[${PYTHON_USEDEP}]
22 dev-python/setuptools_scm[${PYTHON_USEDEP}]"
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
29 distutils-r1_src_prepare
33 local -x PYTHONPATH=${PWD}${PYTHONPATH:+:}${PYTHONPATH}
34 py.test -vv test_pytest_mock.py || die "Tests fail with ${EPYTHON}"