Skip to content

Commit f2261a5

Browse files
author
Graham Higgins
committed
Amend tests to skip known pypy/jython issues
1 parent 846fdc2 commit f2261a5

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

test/rdfa/run_w3c_rdfa_testsuite.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
XHTML_RDFA_TEST_MANIFEST_URL = ("http://www.w3.org/2006/07/SWD/RDFa/"
3333
"testsuite/xhtml1-testcases/rdfa-xhtml1-test-manifest.rdf")
3434

35-
3635
class TestCase(object):
3736
def __init__(self, graph, tc_uri):
3837
val = lambda p: graph.value(tc_uri, p)
@@ -120,6 +119,10 @@ def all_tests(skip_known_issues=True):
120119
"""
121120
Generator used to expose test functions. The Nose test runner use this.
122121
"""
122+
import platform
123+
if platform.system() == 'Java':
124+
from nose import SkipTest
125+
raise SkipTest('html5lib unavailable in Jython2.5')
123126
for tc in get_tcs():
124127
label = "RDFa TC #%(number)s: %(title)s (%(status)s)"%vars(tc)
125128
urls = "[<%(html_url)s>, <%(sparql_url)s>]"%vars(tc)
@@ -137,7 +140,6 @@ def do_test():
137140
do_test._source_urls = urls
138141
yield do_test,
139142

140-
141143
def manual_run():
142144
errors, failed, count = 0, 0, 0
143145
for test, in all_tests(skip_known_issues=False):
@@ -152,7 +154,4 @@ def manual_run():
152154

153155

154156
if __name__ == '__main__':
155-
156157
manual_run()
157-
158-

test/test_datetime.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ def test_equality(self):
1717
self.assertEquals(self.x == self.x, True)
1818

1919
def test_microseconds(self):
20+
import platform
21+
if platform.system() == 'Java' or (platform.system() != 'Java' and sys.version_info[:2] == (2, 5)):
22+
from nose import SkipTest
23+
raise SkipTest('datetime microseconds unsupported in Python2.5 and Jython')
2024
dt1 = datetime(2009, 6, 15, 23, 37, 6, 522630)
2125
l = Literal(dt1)
2226

test/test_graph.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,14 @@ def testFinalNewline(self):
288288
"""
289289
http://code.google.com/p/rdflib/issues/detail?id=5
290290
"""
291+
import sys
292+
import platform
293+
if getattr(sys, 'pypy_version_info', None) or platform.system() == 'Java':
294+
from nose import SkipTest
295+
raise SkipTest(
296+
'Testing under pypy and Jython2.5 fails to detect that ' + \
297+
'IOMemory is a context_aware store')
298+
291299
failed = set()
292300
for p in rdflib.plugin.plugins(None, rdflib.plugin.Serializer):
293301
if p.name is not 'nquads':

test/test_issue084.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,21 @@ def test_e():
9090

9191
def test_xml_a():
9292
"""Test reading XML from a unicode object as data"""
93+
import platform
94+
if platform.system() == 'Java':
95+
from nose import SkipTest
96+
raise SkipTest('unicode issue for Jython2.5')
9397
g = Graph()
9498
g.parse(data=rdfxml, format='xml')
9599
v = g.value(subject=URIRef("http://www.test.org/#CI"), predicate=URIRef("http://www.w3.org/2004/02/skos/core#prefLabel"))
96100
assert v==u"C\u00f4te d'Ivoire"
97101

98102
def test_xml_b():
99103
"""Test reading XML from a utf8 encoded string object as data"""
104+
import platform
105+
if platform.system() == 'Java':
106+
from nose import SkipTest
107+
raise SkipTest('unicode issue for Jython2.5')
100108
g = Graph()
101109
g.parse(data=rdfxml_utf8, format='xml')
102110
v = g.value(subject=URIRef("http://www.test.org/#CI"), predicate=URIRef("http://www.w3.org/2004/02/skos/core#prefLabel"))
@@ -119,6 +127,10 @@ def test_xml_b():
119127

120128
def test_xml_e():
121129
"""Test reading XML from a BytesIO created from utf8 encoded string"""
130+
import platform
131+
if platform.system() == 'Java':
132+
from nose import SkipTest
133+
raise SkipTest('unicode issue for Jython2.5')
122134
g = Graph()
123135
g.parse(source=BytesIO(rdfxml_utf8), format='xml')
124136
v = g.value(subject=URIRef("http://www.test.org/#CI"), predicate=URIRef("http://www.w3.org/2004/02/skos/core#prefLabel"))

0 commit comments

Comments
 (0)