FTBFS 2:2.2.24-1 test_subparser_invalid_option regression with Python 3.9

Bug #1945993 reported by Athos Ribeiro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-django (Ubuntu)
Fix Released
Undecided
Athos Ribeiro

Bug Description

python-django FTBFS due to an error on the test suite (see error log below).

This issue is due to changes in python's argparse code which was backported to python 3.9. This has been fixed upstream [1,2].

The bug has also been fixed in Debian [3], however, Debian unstable has migrated to python-django 3. Hence, we should add a delta for impish, which can be dropped later for the jj series when we move to django 3.

[1] https://code.djangoproject.com/ticket/33082
[2] https://github.com/django/django/pull/14826/files
[3] https://salsa.debian.org/python-team/packages/python-django/-/blob/debian/sid/debian/patches/0006-Skip-a-test-that-is-fixed-upstream.patch

======================================================================
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 "/<<PKGBUILDDIR>>/tests/user_commands/tests.py", line 223, 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 "/<<PKGBUILDDIR>>/django/test/testcases.py", line 676, 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')"

Related branches

Changed in python-django (Ubuntu):
assignee: nobody → Athos Ribeiro (athos-ribeiro)
tags: added: update-excuse
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

While the test change itself is unlikely to be the cause for the lava test suite error. I asked Lucas Kanashiro to re-trigger the tests and I will investigate the issue after I get the results.

Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

Thanks, Sergio, for updating the tags!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-django - 2:2.2.24-1ubuntu1

---------------
python-django (2:2.2.24-1ubuntu1) impish; urgency=medium

  * d/p/test_subparser_regression.patch: Fix test regression (LP: #1945993)

 -- Athos Ribeiro <email address hidden> Mon, 04 Oct 2021 10:56:57 -0300

Changed in python-django (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.