Skip to content

Commit

Permalink
Add support for Python 3.13
Browse files Browse the repository at this point in the history
Start testing on 3.13, and fix a test for the change introduced in
python/cpython#103232.
  • Loading branch information
cjwatson committed Nov 7, 2024
1 parent 608b053 commit 18a39fa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions testfixtures/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
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)
7 changes: 5 additions & 2 deletions testfixtures/tests/test_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
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

Expand Down Expand Up @@ -1362,7 +1362,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'")):
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):
Expand Down

0 comments on commit 18a39fa

Please sign in to comment.