dev-python/rdflib: add -test.patch
authorIan Delaney <idella4@gentoo.org>
Wed, 19 Aug 2015 10:01:31 +0000 (18:01 +0800)
committerIan Delaney <idella4@gentoo.org>
Wed, 19 Aug 2015 10:05:32 +0000 (18:05 +0800)
fixes upstream https://github.com/RDFLib/rdflib/issues/396

Package-Manager: portage-2.2.20

dev-python/rdflib/files/rdflib-4-test.patch [new file with mode: 0644]
dev-python/rdflib/rdflib-4.1.2.ebuild
dev-python/rdflib/rdflib-4.2.0.ebuild

diff --git a/dev-python/rdflib/files/rdflib-4-test.patch b/dev-python/rdflib/files/rdflib-4-test.patch
new file mode 100644 (file)
index 0000000..e79e3ff
--- /dev/null
@@ -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()
+
index ea599e27a076ea6d78705285100f762261d5ca1a..72974e69a1fd9a46a6a71f6b4ba3b88540e2bc76 100644 (file)
@@ -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
index 294c0a58657fc50e5efce742c3495f99ca8cf440..88878bec6ec2737c0aa87eae09b4ea4dd049de63 100644 (file)
@@ -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