diff -ur mechanize.orig/mechanize-0.2.5.ebuild mechanize/mechanize-0.2.5.ebuild --- mechanize.orig/mechanize-0.2.5.ebuild 2012-06-12 23:59:19.867742243 +0800 +++ mechanize/mechanize-0.2.5.ebuild 2012-06-12 23:59:50.323743776 +0800 @@ -7,7 +7,7 @@ SUPPORT_PYTHON_ABIS="1" RESTRICT_PYTHON_ABIS="3.*" -inherit distutils +inherit distutils eutils DESCRIPTION="Stateful programmatic web browsing in Python" HOMEPAGE="http://wwwsearch.sourceforge.net/mechanize/ http://pypi.python.org/pypi/mechanize" @@ -23,8 +23,19 @@ DOCS="docs/*.txt" +src_prepare() { + cp -f test/test_unittest.py test/test_unittest.pyy + epatch "${FILESDIR}"/${PN}-pypy_test.patch \ + "${FILESDIR}"/${P}-doctest.patch +} + src_test() { testing() { + # Ignore warnings (http://github.com/jjlee/mechanize/issues/issue/13). + local path="${S}/build-${PYTHON_ABI}/lib/" + if [[ "${PYTHON_ABI:4:4}" == "pypy" ]]; then + cp test/test_unittest.pyy test/test_unittest.py || die + fi PYTHONPATH=$path "$(PYTHON)" -W ignore test.py } python_execute_function testing