dev-python/elementpath: Enable tests
authorMichał Górny <mgorny@gentoo.org>
Thu, 21 Nov 2019 17:12:22 +0000 (18:12 +0100)
committerMichał Górny <mgorny@gentoo.org>
Thu, 21 Nov 2019 17:25:49 +0000 (18:25 +0100)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
dev-python/elementpath/elementpath-1.3.1.ebuild

index 09b5ee6f3ace24cb990ca9307f7e9018a1d52963..4884138e88426932cc3ba41597195a1fed0a2f2b 100644 (file)
@@ -14,7 +14,23 @@ SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz"
 LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
+IUSE="test"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
-       dev-python/setuptools[${PYTHON_USEDEP}]"
+       dev-python/setuptools[${PYTHON_USEDEP}]
+       test? (
+               dev-python/lxml[${PYTHON_USEDEP}]
+               dev-python/xmlschema[${PYTHON_USEDEP}]
+       )"
+
+distutils_enable_tests unittest
+
+src_prepare() {
+       distutils-r1_src_prepare
+
+       # this test fails depending on system locale + requires some random
+       # locales being installed
+       sed -e 's:test_compare_strings_function:_&:' \
+               -i tests/test_xpath2_parser.py || die
+}