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
|
From: Stefano Rivera <stefano@rivera.za.net>
Date: Fri, 18 Nov 2022 22:43:35 +0200
Subject: Python 3.11 support [bpo-46730]
The AttributeError message for a missing property setter changed in
bpo-46730.
Bug-Debian: https://bugs.debian.org/1024043
Forwarded: https://github.com/datastax/python-driver/pull/1131
---
tests/unit/test_policies.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tests/unit/test_policies.py b/tests/unit/test_policies.py
index 5c0c112..bdd7c58 100644
--- a/tests/unit/test_policies.py
+++ b/tests/unit/test_policies.py
@@ -1298,7 +1298,10 @@ class HostFilterPolicyInitTest(unittest.TestCase):
))
def test_immutable_predicate(self):
- expected_message_regex = "can't set attribute"
+ if sys.version_info >= (3, 11):
+ expected_message_regex = "has no setter"
+ else:
+ expected_message_regex = "can't set attribute"
hfp = HostFilterPolicy(child_policy=Mock(name='child_policy'),
predicate=Mock(name='predicate'))
with self.assertRaisesRegexp(AttributeError, expected_message_regex):
|