Skip to content

Please port to Python3.12 #28194

@tillea

Description

@tillea

Describe the bug

The test suite does not pass when using Python3.12 as it is reported in a Debian bug report. It results in

E       AttributeError: 'TestApplication' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?
tests_core/test_application.py:56: AttributeError
E       AttributeError: 'TestApplication' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?
tests_core/test_application.py:35: AttributeError
E           AttributeError: 'TestCommandRegistration' object has no attribute 'assertDictContainsSubset'
tests_core/test_command_registration.py:96: AttributeError
E           AttributeError: 'TestCommandRegistration' object has no attribute 'assertDictContainsSubset'
tests_core/test_command_registration.py:564: AttributeError

While fixing the assertNotEquals can be easily fixed with this patch assertDictContainsSubset is not supported any more as you can read in the Python3.12 documentation.
(BTW, the patch is against the Debian packaged version 2.50.0 so not the latest release but it should be pretty easy to adapt sind the replacement is simple.)

Related command

Simply run the test suite under Python3.12.

Errors

E       AttributeError: 'TestApplication' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?
tests_core/test_application.py:56: AttributeError
E       AttributeError: 'TestApplication' object has no attribute 'assertNotEquals'. Did you mean: 'assertNotEqual'?
tests_core/test_application.py:35: AttributeError
E           AttributeError: 'TestCommandRegistration' object has no attribute 'assertDictContainsSubset'
tests_core/test_command_registration.py:96: AttributeError
E           AttributeError: 'TestCommandRegistration' object has no attribute 'assertDictContainsSubset'
tests_core/test_command_registration.py:564: AttributeError

Issue script & Debug output

See above

Expected behavior

The unittest should be passed when using Python3.12.

Environment Summary

azure-cli 2.50.0

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-ResolveAuto resolve by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions