Skip to content

Commit 231216d

Browse files
rascanifacebook-github-bot
authored andcommitted
test_partitioner_with_spec: accept Python 3.12 setter error message
Summary: Python 3.12 changed the AttributeError message emitted when assigning to a property without a setter, from "can't set attribute 'spec'" to "property 'spec' of 'CustomPartitioner' object has no setter". The `assertRaisesRegex` in `test_partitioner_with_spec` only matched the pre-3.12 form, so the test failed on the Python 3.12 runtime. Updated the regex to match either form. Authored with Claude. Differential Revision: D104316540
1 parent fa857bd commit 231216d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

exir/backend/test/test_partitioner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def partition(
106106

107107
with self.assertRaisesRegex(
108108
AttributeError,
109-
"can't set attribute 'spec'",
109+
r"(can't set attribute 'spec'|property 'spec' of .* object has no setter)",
110110
):
111111
my_partitioner.spec = {"new_key": "new_value"}
112112

0 commit comments

Comments
 (0)