--- /dev/null
+ testing/acceptance_test.py | 2 ++
+ testing/python/collect.py | 1 +
+ testing/python/fixture.py | 1 +
+ testing/python/metafunc.py | 1 +
+ testing/test_capture.py | 3 ++-
+ testing/test_collection.py | 1 +
+ testing/test_junitxml.py | 1 +
+ 7 files changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py
+index b9a3fa3..9db5017 100644
+--- a/testing/acceptance_test.py
++++ b/testing/acceptance_test.py
+@@ -209,6 +209,8 @@ class TestGeneralUsage:
+ result = testdir.runpython(p)
+ assert not result.ret
+
++ # https://github.com/pytest-dev/pytest/issues/1162
++ @pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_issue109_sibling_conftests_not_loaded(self, testdir):
+ sub1 = testdir.tmpdir.mkdir("sub1")
+ sub2 = testdir.tmpdir.mkdir("sub2")
+diff --git a/testing/python/collect.py b/testing/python/collect.py
+index 636f959..da9a291 100644
+--- a/testing/python/collect.py
++++ b/testing/python/collect.py
+@@ -659,6 +659,7 @@ class TestConftestCustomization:
+ l = modcol.collect()
+ assert '_hello' not in l
+
++@pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_setup_only_available_in_subdir(testdir):
+ sub1 = testdir.mkpydir("sub1")
+ sub2 = testdir.mkpydir("sub2")
+diff --git a/testing/python/fixture.py b/testing/python/fixture.py
+index 2031764..f52cf85 100644
+--- a/testing/python/fixture.py
++++ b/testing/python/fixture.py
+@@ -83,6 +83,7 @@ class TestFillFixtures:
+ "*1 passed*"
+ ])
+
++ @pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_conftest_funcargs_only_available_in_subdir(self, testdir):
+ sub1 = testdir.mkpydir("sub1")
+ sub2 = testdir.mkpydir("sub2")
+diff --git a/testing/python/metafunc.py b/testing/python/metafunc.py
+index 111ca61..bc489fa 100644
+--- a/testing/python/metafunc.py
++++ b/testing/python/metafunc.py
+@@ -835,6 +835,7 @@ class TestMetafuncFunctional:
+ reprec = testdir.runpytest()
+ reprec.assert_outcomes(passed=1)
+
++ @pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_generate_tests_only_done_in_subdir(self, testdir):
+ sub1 = testdir.mkpydir("sub1")
+ sub2 = testdir.mkpydir("sub2")
+diff --git a/testing/test_capture.py b/testing/test_capture.py
+index 5393335..d7448e1 100644
+--- a/testing/test_capture.py
++++ b/testing/test_capture.py
+@@ -478,7 +478,8 @@ class TestCaptureFixture:
+ result = testdir.runpytest_subprocess(p)
+ assert 'closed' not in result.stderr.str()
+
+-
++# https://github.com/pytest-dev/pytest/issues/1162
++@pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_setup_failure_does_not_kill_capturing(testdir):
+ sub1 = testdir.mkpydir("sub1")
+ sub1.join("conftest.py").write(py.code.Source("""
+diff --git a/testing/test_collection.py b/testing/test_collection.py
+index 749c5b7..65370a6 100644
+--- a/testing/test_collection.py
++++ b/testing/test_collection.py
+@@ -287,6 +287,7 @@ class TestCustomConftests:
+ "*test_x*"
+ ])
+
++ @pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_pytest_collect_file_from_sister_dir(self, testdir):
+ sub1 = testdir.mkpydir("sub1")
+ sub2 = testdir.mkpydir("sub2")
+diff --git a/testing/test_junitxml.py b/testing/test_junitxml.py
+index b25b6c7..3afd6f2 100644
+--- a/testing/test_junitxml.py
++++ b/testing/test_junitxml.py
+@@ -120,6 +120,7 @@ class TestPython:
+ classname="test_classname_instance.TestClass",
+ name="test_method")
+
++ @pytest.mark.skipif('"__pypy__" in sys.modules')
+ def test_classname_nested_dir(self, testdir):
+ p = testdir.tmpdir.ensure("sub", "test_hello.py")
+ p.write("def test_func(): 0/0")
--- /dev/null
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{3,4,5} pypy pypy3 )
+
+inherit distutils-r1
+
+DESCRIPTION="simple powerful testing with Python"
+HOMEPAGE="http://pytest.org/ https://pypi.python.org/pypi/pytest"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="doc test"
+
+# When bumping, please check setup.py for the proper py version
+PY_VER="1.4.29"
+RDEPEND=">=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]"
+
+# dev-python/pluggy
+# https://github.com/hpk42/pluggy
+# See https://github.com/pytest-dev/pytest/issues/944
+# for why not now
+
+#pexpect dep based on https://bitbucket.org/hpk42/pytest/issue/386/tests-fail-with-pexpect-30
+DEPEND="${RDEPEND}
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( dev-python/pexpect[${PYTHON_USEDEP}] )
+ doc? (
+ >=dev-python/sphinx-1.2.3[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/regendoc[${PYTHON_USEDEP}]
+ )"
+
+PATCHES=( "${FILESDIR}"/${P}-skip-test-on-pypy.patch )
+
+python_prepare_all() {
+ chmod o-w *egg*/* || die
+ # Disable versioning of py.test script to avoid collision with
+ # versioning performed by the eclass.
+ sed -e "s/return points/return {'py.test': target}/" -i setup.py || die "sed failed"
+ grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
+
+ # Prevent un-needed d'loading
+ sed -e "s/'sphinx.ext.intersphinx', //" -i doc/en/conf.py || die
+
+ # https://github.com/pytest-dev/pytest/issues/1162
+ # https://github.com/pytest-dev/pytest/issues/1163
+ sed \
+ -e 's:test_logging_initialized_in_test:_&:g' \
+ -i testing/test_capture.py || die
+
+ find \( -name __pycache__ -o -name "*.pyc" -o -name "*.pyo" \) \
+ -exec rm -rvf '{}' + || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+ if use doc; then
+ mkdir doc/en/.build || die
+ emake -C doc/en html
+ fi
+}
+
+python_test() {
+ # test_nose.py not written to suit py3.2 in pypy3
+ if [[ "${EPYTHON}" == pypy3 ]]; then
+ "${PYTHON}" "${BUILD_DIR}"/lib/pytest.py -x -v \
+ --ignore=testing/BUILD_nose.py \
+ || die "tests failed with ${EPYTHON}"
+ else
+ "${PYTHON}" "${BUILD_DIR}"/lib/pytest.py -x -v --runpytest=subprocess \
+ || die "tests failed with ${EPYTHON}"
+ fi
+}
+
+python_install_all() {
+ use doc && HTML_DOCS=( doc/en/_build/html/. )
+ distutils-r1_python_install_all
+}