From: Benjamin Drung <bdrung@debian.org>
Date: Thu, 23 Feb 2023 11:57:14 +0100
Subject: Fix test regressions with Python 3.11

The error messages changed in Python 3.11. Just relax the tests to not
check the error message text. Please upgrade to a newer upstream version
and drop this patch.

Bug: https://github.com/jaraco/cssutils/issues/24
Forwarded: not-needed
Signed-off-by: Benjamin Drung <bdrung@debian.org>
---
 src/cssutils/tests/test_property.py | 3 +--
 src/cssutils/tests/test_selector.py | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/cssutils/tests/test_property.py b/src/cssutils/tests/test_property.py
index 765634a..f138284 100644
--- a/src/cssutils/tests/test_property.py
+++ b/src/cssutils/tests/test_property.py
@@ -159,8 +159,7 @@ class PropertyTestCase(basetest.BaseTestCase):
         "Property.literalname"
         p = cssutils.css.property.Property(r'c\olor', 'red')
         self.assertEqual(r'c\olor', p.literalname)
-        self.assertRaisesMsg(AttributeError, "can't set attribute", p.__setattr__,
-                             'literalname', 'color')
+        self.assertRaises(AttributeError, p.__setattr__, 'literalname', 'color')
 
     def test_validate(self):
         "Property.valid"
diff --git a/src/cssutils/tests/test_selector.py b/src/cssutils/tests/test_selector.py
index 7eec407..9a18355 100644
--- a/src/cssutils/tests/test_selector.py
+++ b/src/cssutils/tests/test_selector.py
@@ -409,7 +409,7 @@ class SelectorTestCase(basetest.BaseTestCase):
 
         # readonly
         def _set(): selector.specificity = 1
-        self.assertRaisesMsg(AttributeError, "can't set attribute", _set)
+        self.assertRaises(AttributeError, _set)
 
         tests = {
             '*': (0,0,0,0),
