diff --git a/python-testfixtures.changes b/python-testfixtures.changes index bc2aaa5..2194f0b 100644 --- a/python-testfixtures.changes +++ b/python-testfixtures.changes @@ -1,3 +1,23 @@ +------------------------------------------------------------------- +Thu Sep 26 04:56:43 UTC 2024 - Steve Kowalik + +- Add patch support-python-313.patch: + * Support Python 3.13 AttributeError message changes. + +------------------------------------------------------------------- +Sun Jun 30 08:18:06 UTC 2024 - Dirk Müller + +- update to 8.3.0: + * :class:`ShouldRaise` now supports :class:`ExceptionGroup`. + * Fixed bug where + :func:`~testfixtures.comparison.compare_generator` did not + respect strict=True. + * Fixed bug in the type annotations for :class:`ShouldRaise` + and :func:`~testfixtures.comparison.compare_exception`. + * :class:`LogCapture` will now raise an exception if closed + while still installed. This can be a source of particularly + confusing bugs. + ------------------------------------------------------------------- Wed May 8 06:08:53 UTC 2024 - Steve Kowalik diff --git a/python-testfixtures.spec b/python-testfixtures.spec index 6153f22..8647dbf 100644 --- a/python-testfixtures.spec +++ b/python-testfixtures.spec @@ -26,12 +26,14 @@ %endif %{?sle15_python_module_pythons} Name: python-testfixtures%{psuffix} -Version: 8.2.0 +Version: 8.3.0 Release: 0 Summary: A collection of helpers and mock objects for unit tests and doc tests License: MIT URL: https://github.com/Simplistix/testfixtures Source: https://files.pythonhosted.org/packages/source/t/testfixtures/testfixtures-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#simplistix/testfixtures#202 +Patch0: support-python-313.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..79faa5f --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,36 @@ +From 291850017e9154b4219fc35d8eca3551724bef94 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Thu, 26 Sep 2024 14:50:58 +1000 +Subject: [PATCH] Support Python 3.13's AttributeError changes + +Python 3.13 has changed the message that is raised with an +AttributeError to provide a hint on how to help avoid it -- but this +breaks a test case. Support both the old and the new message. +--- + testfixtures/tests/test_replace.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/testfixtures/tests/test_replace.py b/testfixtures/tests/test_replace.py +index 073e43c..863981b 100644 +--- a/testfixtures/tests/test_replace.py ++++ b/testfixtures/tests/test_replace.py +@@ -15,6 +15,7 @@ + from unittest import TestCase + + import os ++import sys + + from testfixtures.mock import Mock + from testfixtures.tests import sample1, sample3 +@@ -1362,7 +1363,10 @@ def test_invalid_attribute_on_instance_of_slotted_class(self): + obj = OriginE() + assert not hasattr(obj, '__dict__') + replace_ = Replacer() +- with ShouldRaise(AttributeError("'OriginE' object has no attribute 'bad'")): ++ msg = "'OriginE' object has no attribute 'bad'" ++ if sys.version_info >= (3, 13): ++ msg += " and no __dict__ for setting new attributes" ++ with ShouldRaise(AttributeError(msg)): + replace_(obj, name='bad', replacement=42, strict=self.strict) + + def test_method_on_instance_of_slotted_subclass(self): diff --git a/testfixtures-8.2.0.tar.gz b/testfixtures-8.2.0.tar.gz deleted file mode 100644 index 3274a77..0000000 --- a/testfixtures-8.2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef43b657134c87e8a3044f4b02a32ae2ebddf44b2b97bc7989a20116403988ee -size 136662 diff --git a/testfixtures-8.3.0.tar.gz b/testfixtures-8.3.0.tar.gz new file mode 100644 index 0000000..855dd85 --- /dev/null +++ b/testfixtures-8.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4c0b84af2f267610f908009b50d6f983a4e58ade22c67bab6787b5a402d59c0 +size 137420