Skip to content

Commit

Permalink
Fix unit tests for lxml
Browse files Browse the repository at this point in the history
  • Loading branch information
medley56 committed Sep 1, 2024
1 parent e3388a0 commit 15336ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/unit/test_xtcedef.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Tests for space_packet_parser.xtcedef"""
# Standard
from io import StringIO
import pytest
import io
# Installed
import pytest
import lxml.etree as ElementTree
# Local
from space_packet_parser import xtcedef, parser
Expand Down Expand Up @@ -39,9 +39,9 @@ def test_invalid_parameter_type_error(test_data_dir):
</xtce:TelemetryMetaData>
</xtce:SpaceSystem>
"""
x = StringIO(test_xtce_document)
x = io.TextIOWrapper(io.BytesIO(test_xtce_document.encode("utf-8")))
with pytest.raises(xtcedef.InvalidParameterTypeError):
xtcedef.XtcePacketDefinition(x, ns=TEST_NAMESPACE)
xtcedef.XtcePacketDefinition(x)


def test_unsupported_parameter_type_error(test_data_dir):
Expand Down Expand Up @@ -80,9 +80,9 @@ def test_unsupported_parameter_type_error(test_data_dir):
</xtce:TelemetryMetaData>
</xtce:SpaceSystem>
"""
x = StringIO(test_xtce_document)
x = io.TextIOWrapper(io.BytesIO(test_xtce_document.encode("utf-8")))
with pytest.raises(NotImplementedError):
xtcedef.XtcePacketDefinition(x, ns=TEST_NAMESPACE)
xtcedef.XtcePacketDefinition(x)


def test_attr_comparable():
Expand Down

0 comments on commit 15336ec

Please sign in to comment.