summaryrefslogtreecommitdiff
path: root/dev-python/zconfig/files/zconfig-4.0-py312.patch
blob: 6f8c53ed18a05f4accddfb11d6372bdfe60f9d61 (plain)
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
From 390ce89cfd4bf1a60d8d67ee20106288cbfa0e51 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20Van=C4=9Bk?= <arkamar@atlas.cz>
Date: Fri, 23 Jun 2023 08:10:09 +0200
Subject: [PATCH] Fix tests for Python 3.12 (#91)

In the tests, remove the assertRaisesRegexp method, deprecated since
Python 3.2, to prevent test failures following the method's removal in
Python 3.12.
---
 src/ZConfig/tests/support.py | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/ZConfig/tests/support.py b/src/ZConfig/tests/support.py
index 959f2b9..559c015 100644
--- a/src/ZConfig/tests/support.py
+++ b/src/ZConfig/tests/support.py
@@ -17,7 +17,6 @@
 import contextlib
 import os
 import sys
-import unittest
 from io import StringIO
 from urllib.request import pathname2url
 
@@ -79,12 +78,6 @@ def f2(self):
 class TestHelper:
     """Utility methods which can be used with the schema support."""
 
-    # Not derived from unittest.TestCase; some test runners seem to
-    # think that means this class contains tests.
-
-    assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex',
-                                unittest.TestCase.assertRaisesRegexp)
-
     def load_both(self, schema_url, conf_url):
         schema = self.load_schema(schema_url)
         conf = self.load_config(schema, conf_url)