Opened 3 years ago
Last modified 3 years ago
#33082 closed Cleanup/optimization
test_subparser_invalid_option regression with Python 3.9.7 — at Initial Version
Reported by: | Michał Górny | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm getting the following test failure with Python 3.9.7:
`
======================================================================
FAIL: test_subparser_invalid_option (user_commands.tests.CommandTests)
Traceback (most recent call last):
File "/usr/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
yield
File "/usr/lib/python3.9/unittest/case.py", line 592, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
method()
File "/tmp/portage/dev-python/django-3.2.7/work/Django-3.2.7/tests/user_commands/tests.py", line 339, in test_subparser_invalid_option
management.call_command('subparser', 'test', 12)
File "/usr/lib/python3.9/contextlib.py", line 137, in exit
self.gen.throw(typ, value, traceback)
File "/tmp/portage/dev-python/django-3.2.7/work/Django-3.2.7/django/test/testcases.py", line 693, in _assert_raises_or_warns_cm
self.assertIn(expected_message, str(getattr(cm, cm_attr)))
File "/usr/lib/python3.9/unittest/case.py", line 1096, in assertIn
self.fail(self._formatMessage(msg, standardMsg))
File "/usr/lib/python3.9/unittest/case.py", line 668, in fail
raise self.failureException(msg)
AssertionError: "Error: invalid choice: 'test' (choose from 'foo')" not found in "Error: argument {foo}: invalid choice: 'test' (choose from 'foo')"
`
It seems that the output change has been backported from Python 3.10 to 3.9.7.