Convert `test_sparql/test_tsvresults.py` to pytest
Converting to pytest in preperation for additional tests I will add for:
-import unittest
from io import StringIO
from rdflib.plugins.sparql.results.tsvresults import TSVResultParser
-class TestTSVResults(unittest.TestCase):
- def test_empty_tsvresults_bindings(self):
+def test_empty_tsvresults_bindings() -> None:
# check that optional bindings are ordered properly
source = """?s\t?p\t?o
\t<urn:p>\t<urn:o>
@@ -12,8 +10,8 @@ class TestTSVResults(unittest.TestCase):
<urn:s>\t<urn:p>\t"""
parser = TSVResultParser()
- source = StringIO(source)
- result = parser.parse(source)
+ source_io = StringIO(source)
+ result = parser.parse(source_io)
for idx, row in enumerate(result):
- self.assertTrue(row[idx] is None)
+ assert row[idx] is None
