Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#7303 closed (fixed)

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

Reported by: leosoto Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords: jython
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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 (2)

avoid_checking_for_builtin_dict_order.patch (589 bytes) - added by leosoto 7 years ago.
avoid_checking_for_builtin_dict_order.2.patch (606 bytes) - added by leosoto 7 years ago.
new version, doesn't use sorted

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by leosoto

comment:1 Changed 7 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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

Changed 7 years ago by leosoto

new version, doesn't use sorted

comment:2 Changed 7 years ago by leosoto

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

comment:3 Changed 7 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:4 Changed 7 years ago 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.

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