mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-31 23:08:09 -07:00
dev-python/rdflib: add -test.patch
fixes upstream https://github.com/RDFLib/rdflib/issues/396 Package-Manager: portage-2.2.20
This commit is contained in:
41
dev-python/rdflib/files/rdflib-4-test.patch
Normal file
41
dev-python/rdflib/files/rdflib-4-test.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
https://github.com/joernhees/rdflib/commit/36335d5d178ffbcc0422b8b8ee7444893a30ed84
|
||||
diff --git a/test/test_issue375.py b/test/test_issue375.py
|
||||
index 29726b9..17f168b 100644
|
||||
--- a/test/test_issue375.py
|
||||
+++ b/test/test_issue375.py
|
||||
@@ -1,4 +1,6 @@
|
||||
+import os
|
||||
import subprocess
|
||||
+import sys
|
||||
import re
|
||||
|
||||
rdfa_expected = u'''@prefix dc: <http://purl.org/dc/terms/> .
|
||||
@@ -146,6 +148,9 @@
|
||||
rdfa:usesVocabulary schema: .
|
||||
'''.strip()
|
||||
|
||||
+env = os.environ.copy()
|
||||
+env['PYTHONPATH'] = '.:' + env.get('PYTHONPATH', '')
|
||||
+
|
||||
def test_rdfpipe_bytes_vs_str():
|
||||
"""
|
||||
Issue 375: rdfpipe command generates bytes vs. str TypeError
|
||||
@@ -155,7 +160,7 @@ def test_rdfpipe_bytes_vs_str():
|
||||
rdfpipe to ensure that we get the expected results.
|
||||
"""
|
||||
args = ['python', 'rdflib/tools/rdfpipe.py', '-i', 'rdfa1.1', 'test/rdfa/oreilly.html']
|
||||
- proc = subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True)
|
||||
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True, env=env)
|
||||
res = ''
|
||||
while proc.poll() is None:
|
||||
res += proc.stdout.read()
|
||||
@@ -170,7 +175,7 @@ def test_rdfpipe_mdata_open():
|
||||
the open() builtin instead.
|
||||
"""
|
||||
args = ['python', 'rdflib/tools/rdfpipe.py', '-i', 'mdata', 'test/mdata/codelab.html']
|
||||
- proc = subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True)
|
||||
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE, universal_newlines=True, env=env)
|
||||
res = ''
|
||||
while proc.poll() is None:
|
||||
res += proc.stdout.read()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
# Copyright 1999-2015 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Id$
|
||||
@@ -34,6 +33,8 @@ DEPEND="${RDEPEND}
|
||||
test? ( dev-python/sparql-wrapper[${PYTHON_USEDEP}]
|
||||
>=dev-python/nose-1.3.1-r1[${PYTHON_USEDEP}] )"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${PN}-4-test.patch )
|
||||
|
||||
python_prepare_all() {
|
||||
# Upstream manufactured .pyc files which promptly break distutils' src_test
|
||||
find -name "*.py[oc~]" -delete || die
|
||||
@@ -46,15 +47,9 @@ python_prepare_all() {
|
||||
}
|
||||
|
||||
python_test() {
|
||||
# the default; nose with: --where=./ does not work for python3
|
||||
if python_is_python3; then
|
||||
pushd "${BUILD_DIR}/src/" > /dev/null
|
||||
if [[ "${EPYTHON}" == 'python3.4' ]]; then
|
||||
sed -e 's:test_rdfpipe_bytes_vs_str:_&:' \
|
||||
-e 's:test_rdfpipe_mdata_open:_&:' \
|
||||
-i test/test_issue375.py || die
|
||||
sed -e 's:testHTML:_&:' \
|
||||
-i test/test_xmlliterals.py || die
|
||||
fi
|
||||
"${PYTHON}" ./run_tests.py || die "Tests failed under ${EPYTHON}"
|
||||
popd > /dev/null
|
||||
else
|
||||
|
||||
@@ -33,6 +33,8 @@ DEPEND="${RDEPEND}
|
||||
test? ( dev-python/sparql-wrapper[${PYTHON_USEDEP}]
|
||||
>=dev-python/nose-1.3.1-r1[${PYTHON_USEDEP}] )"
|
||||
|
||||
PATCHES=( "${FILESDIR}"/${PN}-4-test.patch )
|
||||
|
||||
python_prepare_all() {
|
||||
# Upstream manufactured .pyc files which promptly break distutils' src_test
|
||||
find -name "*.py[oc~]" -delete || die
|
||||
@@ -45,15 +47,9 @@ python_prepare_all() {
|
||||
}
|
||||
|
||||
python_test() {
|
||||
# the default; nose with: --where=./ does not work for python3
|
||||
if python_is_python3; then
|
||||
pushd "${BUILD_DIR}/src/" > /dev/null
|
||||
if [[ "${EPYTHON}" == 'python3.4' ]]; then
|
||||
sed -e 's:test_rdfpipe_bytes_vs_str:_&:' \
|
||||
-e 's:test_rdfpipe_mdata_open:_&:' \
|
||||
-i test/test_issue375.py || die
|
||||
sed -e 's:testHTML:_&:' \
|
||||
-i test/test_xmlliterals.py || die
|
||||
fi
|
||||
"${PYTHON}" ./run_tests.py || die "Tests failed under ${EPYTHON}"
|
||||
popd > /dev/null
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user