diff --git a/pynetdicom/tests/test_assoc_user.py b/pynetdicom/tests/test_assoc_user.py index 95a623f4d..8f5ecb0b5 100644 --- a/pynetdicom/tests/test_assoc_user.py +++ b/pynetdicom/tests/test_assoc_user.py @@ -164,7 +164,7 @@ def test_mode_assignment_raises(self): """Test that assigning mode after init raises exception.""" user = ServiceUser(self.assoc, mode="acceptor") assert user.mode == "acceptor" - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.mode = "requestor" assert user.mode == "acceptor" @@ -297,22 +297,22 @@ def test_primitive_assignment_raises(self): with pytest.raises(RuntimeError, match=msg): user.implementation_version_name = "1.2.3" - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.asynchronous_operations = (1, 1) - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.role_selection = {} - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.sop_class_common_extended = {} - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.sop_class_extended = {} - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.user_identity = "test" - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.extended_negotiation = [] def test_add_neg_pre(self): @@ -1477,7 +1477,7 @@ def test_mode_assignment_raises(self): """Test that assigning mode after init raises exception.""" user = ServiceUser(self.assoc, mode="requestor") assert user.mode == "requestor" - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.mode = "acceptor" assert user.mode == "requestor" @@ -1601,22 +1601,22 @@ def test_primitive_assignment_raises(self): with pytest.raises(RuntimeError, match=msg): user.implementation_version_name = "1.2.3" - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.asynchronous_operations = (1, 1) - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.role_selection = {} - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.sop_class_common_extended = {} - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.sop_class_extended = {} - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.user_identity = "test" - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): user.extended_negotiation = [] def test_accepted_common_raises(self): diff --git a/pynetdicom/tests/test_presentation.py b/pynetdicom/tests/test_presentation.py index 8153bb10a..54cd194f6 100644 --- a/pynetdicom/tests/test_presentation.py +++ b/pynetdicom/tests/test_presentation.py @@ -374,7 +374,7 @@ def test_as_scp(self): context = build_context("1.2.3") assert context.as_scp is None - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): context.as_scp = True context._as_scp = True @@ -387,7 +387,7 @@ def test_as_scu(self): context = build_context("1.2.3") assert context.as_scu is None - with pytest.raises(AttributeError, match=r"can't set attribute"): + with pytest.raises(AttributeError, match=r"can't set attribute|has no setter"): context.as_scu = True context._as_scu = True