From: Colin Watson <cjwatson@debian.org>
Date: Thu, 7 Nov 2024 08:53:28 +0000
Subject: Add support for Python 3.13

Start testing on 3.13, and fix a test for the change introduced in
https://github.com/python/cpython/pull/103232.

Origin: upstream, https://github.com/simplistix/testfixtures/pull/203
Bug-Debian: https://bugs.debian.org/1082272
Last-Update: 2024-11-08
---
 .circleci/config.yml               | 1 +
 testfixtures/compat.py             | 1 +
 testfixtures/tests/test_replace.py | 7 +++++--
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index ee9b17b..299eec9 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -37,6 +37,7 @@ common: &common
               - cimg/python:3.10
               - cimg/python:3.11
               - cimg/python:3.12
+              - cimg/python:3.13
     - python/pip-run-tests:
         name: mock-backport
         image: cimg/python:3.11
diff --git a/testfixtures/compat.py b/testfixtures/compat.py
index 0ec7cb4..162bf11 100644
--- a/testfixtures/compat.py
+++ b/testfixtures/compat.py
@@ -8,3 +8,4 @@ PY_39_PLUS: bool = PY_VERSION >= (3, 9)
 PY_310_PLUS: bool = PY_VERSION >= (3, 10)
 PY_311_PLUS: bool = PY_VERSION >= (3, 11)
 PY_312_PLUS: bool = PY_VERSION >= (3, 12)
+PY_313_PLUS: bool = PY_VERSION >= (3, 13)
diff --git a/testfixtures/tests/test_replace.py b/testfixtures/tests/test_replace.py
index 073e43c..dbea35b 100644
--- a/testfixtures/tests/test_replace.py
+++ b/testfixtures/tests/test_replace.py
@@ -21,7 +21,7 @@ from testfixtures.tests import sample1, sample3
 from testfixtures.tests import sample2
 from .sample1 import z, X
 from .sample3 import SOME_CONSTANT
-from ..compat import PY_310_PLUS
+from ..compat import PY_310_PLUS, PY_313_PLUS
 
 from warnings import catch_warnings
 
@@ -1362,7 +1362,10 @@ class TestReplaceWithInterestingOriginsNotStrict(TestReplaceWithInterestingOrigi
         obj = OriginE()
         assert not hasattr(obj, '__dict__')
         replace_ = Replacer()
-        with ShouldRaise(AttributeError("'OriginE' object has no attribute 'bad'")):
+        message = "'OriginE' object has no attribute 'bad'"
+        if PY_313_PLUS:
+            message += " and no __dict__ for setting new attributes"
+        with ShouldRaise(AttributeError(message)):
             replace_(obj, name='bad', replacement=42, strict=self.strict)
 
     def test_method_on_instance_of_slotted_subclass(self):
