This code: ``` from unittest import TestCase _testcase = TestCase('setUp') getattr(_testcase, 'assertRaisesRegex', _testcase.assertRaisesRegexp) ``` was working in Python 3.11, but doesn't work anymore in 3.12: AttributeError: 'TestCase' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
The default value was previously ignored, while now it is evaluated even if it is not required. Is this an expected change behavior in Python 3.12?
The assertRaisesRegexp alias was removed in Python 3.12, along with a number of other previously-deprecated TestCase method aliases. You can search for it in https://docs.python.org/3.12/whatsnew/3.12.html. Upstream should just use assertRaisesRegex unconditionally unless they are trying to support Python 2.7.
On Sun, Jul 9, 2023, at 1:27 PM, Mattia Verga wrote:
This code:
from unittest import TestCase _testcase = TestCase('setUp') getattr(_testcase, 'assertRaisesRegex', _testcase.assertRaisesRegexp)
was working in Python 3.11, but doesn't work anymore in 3.12: AttributeError: 'TestCase' object has no attribute 'assertRaisesRegexp'. Did you mean: 'assertRaisesRegex'?
The default value was previously ignored, while now it is evaluated even if it is not required. Is this an expected change behavior in Python 3.12? _______________________________________________ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproje... Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
python-devel@lists.fedoraproject.org