Skip to content

Commit

Permalink
test: convert test/test_namespace/test_namespace.py to pytest (#2060)
Browse files Browse the repository at this point in the history
Convert the remaining unittest based classes to pytest.
  • Loading branch information
aucampia authored Jul 29, 2022
1 parent 346ccba commit 7864311
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/test_namespace/test_namespace.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import unittest
from contextlib import ExitStack
from typing import Any, Optional, Type, Union
from unittest.case import expectedFailure
from warnings import warn

import pytest
Expand All @@ -22,7 +20,7 @@
from rdflib.term import URIRef


class NamespaceTest(unittest.TestCase):
class TestNamespace:
def setup_method(self, method):
self.ns_str = "http://example.com/name/space/"
self.ns = Namespace(self.ns_str)
Expand All @@ -48,7 +46,7 @@ def test_iri(self):
assert ns["jörn"].startswith(ns)


class ClosedNamespaceTest(unittest.TestCase):
class TestClosedNamespace:
def setup_method(self, method):
self.ns_str = "http://example.com/name/space/"
self.ns = ClosedNamespace(self.ns_str, ["a", "b", "c"])
Expand All @@ -57,7 +55,7 @@ def test_repr(self):
# NOTE: this assumes ns_str has no characthers that need escaping
assert self.ns_str in f"{self.ns!r}"

@expectedFailure
@pytest.mark.xfail
def test_repr_ef(self):
"""
This fails because ClosedNamespace repr does not represent the second argument
Expand Down

0 comments on commit 7864311

Please sign in to comment.