From f4b6aa1a52edacd0b2f38e127c1a332c91ebd465 Mon Sep 17 00:00:00 2001 From: scaramallion Date: Thu, 9 Nov 2023 10:46:18 +1100 Subject: [PATCH] Remove warning tests --- pynetdicom/tests/test_presentation.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pynetdicom/tests/test_presentation.py b/pynetdicom/tests/test_presentation.py index 966bf6582..29a5f7418 100644 --- a/pynetdicom/tests/test_presentation.py +++ b/pynetdicom/tests/test_presentation.py @@ -118,8 +118,7 @@ def test_add_transfer_syntax_nonconformant(self, caplog): msg = r"'transfer_syntax' contains an invalid UID" with pytest.raises(ValueError, match=msg): - with pytest.warns(UserWarning, match="Invalid value for VR UI"): - pc.add_transfer_syntax("1.2.3.") + pc.add_transfer_syntax("1.2.3.") assert msg in caplog.text @@ -130,8 +129,7 @@ def test_add_transfer_syntax_nonconformant(self, caplog): ) _config.ENFORCE_UID_CONFORMANCE = False - with pytest.warns(UserWarning, match="Invalid value for VR UI"): - pc.add_transfer_syntax("1.2.3.") + pc.add_transfer_syntax("1.2.3.") assert "1.2.3." in pc.transfer_syntax def test_add_private_transfer_syntax(self): @@ -294,16 +292,13 @@ def test_abstract_syntax_nonconformant(self, caplog): msg = "Invalid 'abstract_syntax' value '1.4.1.' - UID is non-conformant" with pytest.raises(ValueError, match=msg): - with pytest.warns(UserWarning, match="Invalid value for VR UI"): - pc.abstract_syntax = UID("1.4.1.") + pc.abstract_syntax = UID("1.4.1.") assert pc.abstract_syntax is None _config.ENFORCE_UID_CONFORMANCE = False - with pytest.warns(UserWarning, match="Invalid value for VR UI"): - pc.abstract_syntax = UID("1.4.1.") + pc.abstract_syntax = UID("1.4.1.") - with pytest.warns(UserWarning, match="Invalid value for VR UI"): - assert pc.abstract_syntax == UID("1.4.1.") + assert pc.abstract_syntax == UID("1.4.1.") assert isinstance(pc.abstract_syntax, UID) assert msg in caplog.text @@ -340,8 +335,7 @@ def test_transfer_syntax_nonconformant(self, caplog): caplog.set_level(logging.DEBUG, logger="pynetdicom.presentation") pc = PresentationContext() pc.context_id = 1 - with pytest.warns(UserWarning, match="Invalid value for VR UI"): - pc.transfer_syntax = ["1.4.1.", "1.2.840.10008.1.2"] + pc.transfer_syntax = ["1.4.1.", "1.2.840.10008.1.2"] assert pc.transfer_syntax == ["1.4.1.", "1.2.840.10008.1.2"] assert "A non-conformant UID has been added to 'transfer_syntax'" in caplog.text