Fix namespace test to handle exception during test for ClosedNamespace behaviour
@@ -191,10 +191,11 @@ class NamespacePrefixTest(unittest.TestCase):
"""Tests terms both in an out of the ClosedNamespace FOAF"""
def add_not_in_namespace(s):
+ with self.assertWarnsRegex(UserWarning,
+ 'Code: blah is not defined in namespace FOAF'):
return FOAF[s]
# a non-existent FOAF property
- with self.assertWarnsRegex(UserWarning, 'Code: blah is not defined in namespace FOAF'):
add_not_in_namespace("blah")
# a deprecated FOAF property
