File: replace-assertRegexpMatches-by-assertRegex.patch

package info (click to toggle)
actdiag 3.0.0%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 288 kB
  • sloc: python: 1,281; makefile: 14
file content (71 lines) | stat: -rw-r--r-- 3,469 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Description: Replace assertRegexpMatches by assertRegex
 This is otherwise incompatible with Python 3.12.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2024-04-18

--- actdiag-3.0.0+dfsg1.orig/src/actdiag/tests/test_rst_directives.py
+++ actdiag-3.0.0+dfsg1/src/actdiag/tests/test_rst_directives.py
@@ -131,7 +131,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.image, type(doctree[0]))
         svg = open(doctree[0]['uri']).read()
-        self.assertRegexpMatches(svg, r'<svg height="\d+" width="\d+" ')
+        self.assertRegex(svg, r'<svg height="\d+" width="\d+" ')
 
     def test_setup_noviewbox_is_false(self):
         directives.setup(format='SVG', outputdir=self.tmpdir, noviewbox=False)
@@ -142,7 +142,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.image, type(doctree[0]))
         svg = open(doctree[0]['uri']).read()
-        self.assertRegexpMatches(svg, r'<svg viewBox="0 0 \d+ \d+" ')
+        self.assertRegex(svg, r'<svg viewBox="0 0 \d+ \d+" ')
 
     def test_setup_inline_svg_is_true(self):
         directives.setup(format='SVG', outputdir=self.tmpdir, inline_svg=True)
@@ -189,7 +189,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.raw, type(doctree[0]))
         self.assertEqual(nodes.Text, type(doctree[0][0]))
-        self.assertRegexpMatches(doctree[0][0],
+        self.assertRegex(doctree[0][0],
                                  r'<svg height="\d+" width="100" ')
 
     def test_setup_inline_svg_is_true_and_width_option2(self):
@@ -203,7 +203,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.raw, type(doctree[0]))
         self.assertEqual(nodes.Text, type(doctree[0][0]))
-        self.assertRegexpMatches(doctree[0][0],
+        self.assertRegex(doctree[0][0],
                                  r'<svg height="\d+" width="10000" ')
 
     def test_setup_inline_svg_is_true_and_height_option1(self):
@@ -217,7 +217,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.raw, type(doctree[0]))
         self.assertEqual(nodes.Text, type(doctree[0][0]))
-        self.assertRegexpMatches(doctree[0][0],
+        self.assertRegex(doctree[0][0],
                                  r'<svg height="100" width="\d+" ')
 
     def test_setup_inline_svg_is_true_and_height_option2(self):
@@ -231,7 +231,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.raw, type(doctree[0]))
         self.assertEqual(nodes.Text, type(doctree[0][0]))
-        self.assertRegexpMatches(doctree[0][0],
+        self.assertRegex(doctree[0][0],
                                  r'<svg height="10000" width="\d+" ')
 
     def test_setup_inline_svg_is_true_and_width_and_height_option(self):
@@ -246,7 +246,7 @@ class TestRstDirectives(unittest.TestCas
         self.assertEqual(1, len(doctree))
         self.assertEqual(nodes.raw, type(doctree[0]))
         self.assertEqual(nodes.Text, type(doctree[0][0]))
-        self.assertRegexpMatches(doctree[0][0],
+        self.assertRegex(doctree[0][0],
                                  '<svg height="100" width="200" ')
 
     def test_call_with_braces(self):