Skip to content

Commit

Permalink
Fix tests with optional packages (lxml and xmlschema)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunato committed Aug 14, 2020
1 parent 7132e88 commit 4b3b31b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_schema_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def test_get_primitive_type_api(self):
any_simple_type = schema_proxy.get_type('{%s}anySimpleType' % XSD_NAMESPACE)
self.assertEqual(schema_proxy.get_primitive_type(any_simple_type), any_simple_type)

@unittest.skipIf(xmlschema.__version__ < '1.2.3', "Old find API does not work")
@unittest.skipIf(xmlschema is None or xmlschema.__version__ < '1.2.3',
"Old find API does not work")
def test_find_api(self):
schema_src = """<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="test_element" type="xs:string"/>
Expand Down
1 change: 1 addition & 0 deletions tests/test_xpath1_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ def test_default_namespace(self):
# XPath 1.0 ignores the default namespace declarations
self.check_selector("name(B1)", root, '', namespaces={'': "http://xpath.test/ns"})

@unittest.skipIf(lxml_etree is None, 'lxml is not installed')
def test_issue_25_with_count_function(self):
root = lxml_etree.fromstring("""
<line>
Expand Down

0 comments on commit 4b3b31b

Please sign in to comment.