File: Fix-test-regressions-with-Python-3.11.patch

package info (click to toggle)
cssutils 1.0.2-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,632 kB
  • sloc: python: 20,333; sh: 62; makefile: 20
file content (43 lines) | stat: -rw-r--r-- 1,761 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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),