Skip to content

Commit f34437f

Browse files
committed
Use six.assertRegex instead of assertRegexpMatches for Python 3.11 compatibility.
1 parent cbc9b9e commit f34437f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tests/test_cloud.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import unittest
66

7+
import six
78
from pysolr import SolrCloud, SolrError, ZooKeeper, json
89

910
from .test_client import SolrTestCase
@@ -56,16 +57,16 @@ def test_invalid_collection(self):
5657

5758
def test__create_full_url(self):
5859
# Nada.
59-
self.assertRegexpMatches(
60-
self.solr._create_full_url(path=""), r"http://localhost:89../solr/core0$"
60+
six.assertRegex(
61+
self, self.solr._create_full_url(path=""), r"http://localhost:89../solr/core0$"
6162
)
6263
# Basic path.
63-
self.assertRegexpMatches(
64-
self.solr._create_full_url(path="pysolr_tests"),
64+
six.assertRegex(
65+
self, self.solr._create_full_url(path="pysolr_tests"),
6566
r"http://localhost:89../solr/core0/pysolr_tests$",
6667
)
6768
# Leading slash (& making sure we don't touch the trailing slash).
68-
self.assertRegexpMatches(
69-
self.solr._create_full_url(path="/pysolr_tests/select/?whatever=/"),
69+
six.assertRegex(
70+
self, self.solr._create_full_url(path="/pysolr_tests/select/?whatever=/"),
7071
r"http://localhost:89../solr/core0/pysolr_tests/select/\?whatever=/",
7172
)

0 commit comments

Comments
 (0)