Django

Code

Ticket #7303 (closed: fixed)

Opened 8 months ago

Last modified 6 months ago

tests/regressiontests/utils/datastructures.py: builtin dict ordering is assumed

Reported by: leosoto Assigned to: nobody
Milestone: Component: Uncategorized
Version: SVN Keywords: jython
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

At the end of the doctest it says:

>>> real_dict.values()
 ['one', 'second-two']

Which fails on Jython because dict values have not the same ordering as in CPython.

Attached is a simple patch which uses ordered() to keep the check for dict contents without assuming a default ordering.

Attachments

avoid_checking_for_builtin_dict_order.patch (0.6 kB) - added by leosoto on 05/24/08 21:37:04.
avoid_checking_for_builtin_dict_order.2.patch (0.6 kB) - added by leosoto on 05/25/08 01:07:39.
new version, doesn't use sorted

Change History

05/24/08 21:37:04 changed by leosoto

  • attachment avoid_checking_for_builtin_dict_order.patch added.

05/24/08 21:47:39 changed by Alex

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

sorted() is a python2.5 function so this needs to do the inplace sort and then show the result.

05/25/08 01:07:39 changed by leosoto

  • attachment avoid_checking_for_builtin_dict_order.2.patch added.

new version, doesn't use sorted

05/25/08 01:11:34 changed by leosoto

Right, sorted() is not present on python2.3. I just uploaded a new patch.

07/11/08 09:29:48 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

(In [7890]) Fixed #7303 -- Clarified a test case that was dependent on dict ordering. Thanks to leosoto for the patch.

07/11/08 09:36:17 changed by russellm

Regarding the sorted() issue - there are many other instances where sorted() is used; I've opened ticket #7718 to make sure they get fixed.


Add/Change #7303 (tests/regressiontests/utils/datastructures.py: builtin dict ordering is assumed)




Change Properties
Action