Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#22338 closed Bug (fixed)

test_dict_translation seems to fails with Django 1.6.1, python 3.4 on Fedora

Reported by: anonymous Owned by: nobody
Component: Python 3 Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

======================================================================
FAIL: test_dict_translation (utils_tests.test_datastructures.MultiValueDictTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/python3-python-django-1.6-1.fc21/tests/utils_tests/test_datastructures.py", line 283, in test_dict_translation
    self.assertEqual(list(six.iterkeys(d)), list(six.iterkeys(mvd)))
AssertionError: Lists differ: ['pm', 'devs'] != ['devs', 'pm']
First differing element 0:
pm
devs
- ['pm', 'devs']
+ ['devs', 'pm']
----------------------------------------------------------------------

Full build log: http://mstuchli.fedorapeople.org/build.log

Change History (8)

comment:1 Changed 3 years ago by Tim Graham

I don't think 1.6 is going to support 3.4. Do you get the same error on master and/or 1.7? I can't reproduce it with Python 3.4.0 on any of those branches, but I imagine it probably has to do with undefined ordering of dictionary key iteration and could be fixed by changing list to sorted in the assertion.

comment:2 Changed 3 years ago by anonymous

I don't get the same error on 1.7.x, replacing list with sorted solves the issue on 1.6.1 and I do agree with your analysis. :)

comment:3 Changed 3 years ago by Tim Graham

Resolution: wontfix
Status: newclosed

Hm, ok, if there is no problem on 1.7, then I guess this is just a "won't fix" on the 1.6 branch.

comment:4 Changed 3 years ago by anonymous

Isn't this still a bug in the test suite, though? If, as you say, the order of iteration is undefined, it may very well fail again should the implementation change, so it seems to me that using sorted is just the correct thing to do.

comment:5 Changed 3 years ago by Tim Graham

Resolution: wontfix
Status: closednew
Triage Stage: UnreviewedAccepted

Yes, okay, I see this error on our CI server right now.

comment:6 Changed 3 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 69a4f383f6e84bac16afad103d332103e4e7bcc1:

Fixed #22338 -- Fixed a test dependent on dictionary key iteration order.

comment:7 Changed 3 years ago by Tim Graham <timograham@…>

In 059bc7eb60a43de3679e5a0320f631a30d8e4e13:

[1.6.x] Fixed #22338 -- Fixed a test dependent on dictionary key iteration order.

Backport of 69a4f383f6 from master

comment:8 Changed 3 years ago by Tim Graham <timograham@…>

In 0f9f8738d5599fa3950606c8e6a462f4813e4830:

[1.7.x] Fixed #22338 -- Fixed a test dependent on dictionary key iteration order.

Backport of 69a4f383f6 from master

Note: See TracTickets for help on using tickets.
Back to Top