Title: 2.6 maintenance branch erroneously uses unittest.TestCase.assertListEqual (added in 2.7)
Type: Stage: patch review
Components: Tests Versions: Python 2.6
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: barry, dmalcolm, eric.araujo
Priority: normal Keywords: easy, patch

Created on 2010-11-29 23:27 by dmalcolm, last changed 2010-11-30 01:15 by barry. This issue is now closed.

File name Uploaded Description Edit
2.6-fix-test_setgroups.patch dmalcolm, 2010-11-29 23:27
Messages (3)
msg122872 - (view) Author: Dave Malcolm (dmalcolm) (Python committer) Date: 2010-11-29 23:27
2.6.6 has an erronenous use of a unittest method that was added in 2.7, but it's only seen when running as root.  More specificially, with this guard:
    if posix.getuid() == 0 and hasattr(posix, 'getgroups') and sys.platform != 'darwin':

[david@surprise 2.6-clean]$ sudo ./python -m test.test_posix
ERROR: test_setgroups (__main__.PosixGroupsTester)
Traceback (most recent call last):
  File "/usr/lib64/python2.6/test/", line 356, in test_setgroups
    self.assertListEqual(groups, posix.getgroups())
AttributeError: 'PosixGroupsTester' object has no attribute 'assertListEqual'

Ran 29 tests in 0.020s

FAILED (errors=1)

Seems to have come from r83126.  Fix would seem to be to replace the assertListEqual with AssertEqual.  Am attaching a patch.
msg122874 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-30 00:22
I’m afraid tests are no exception to the rule “only security fixes in stable branches”.
msg122875 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-11-30 01:15
TBH, the fact that this test only runs under sudo is more troublesome.  It's clearly a test that doesn't get run much.  E.g. it sneaked through pre-release testing and doesn't affect the buildbots.

But I agree that this shouldn't be applied to the 2.6 tree.
Date User Action Args
2010-11-30 01:15:32barrysetstatus: open -> closed
resolution: wont fix
messages: + msg122875
2010-11-30 00:22:08eric.araujosetnosy: + barry, eric.araujo
messages: + msg122874
2010-11-29 23:27:18dmalcolmcreate