deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

tests: handle difference in Enum hashes with Python 3.11

Open AdamWill opened this issue 2 years ago • 3 comments

With Python 3.11, Enum members have a _sort_order attribute that shows up in the hashes. Update the tests to pass if it's present (but also still if it's not present, so we still support Python 3.10 and earlier).

Signed-off-by: Adam Williamson [email protected]

AdamWill avatar Jun 22 '22 19:06 AdamWill

Codecov Report

Merging #327 (31b4d4f) into master (81341e2) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #327   +/-   ##
=======================================
  Coverage   99.53%   99.53%           
=======================================
  Files          14       14           
  Lines        2998     2998           
=======================================
  Hits         2984     2984           
  Misses         14       14           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 81341e2...31b4d4f. Read the comment docs.

codecov-commenter avatar Jun 22 '22 21:06 codecov-commenter

Hi @AdamWill Thanks for the PR. Do you think we should just ignore _sort_order_, _name_, and _value_ for enums?

seperman avatar Jun 22 '22 21:06 seperman

I don't know, honestly. I'm just going round trying to clean up things in Fedora that didn't build with Python 3.11, and this was one of them. I don't know enough about the details of what deepdiff wants to do to know if that's the right thing to do. Sorry.

AdamWill avatar Jun 22 '22 21:06 AdamWill

Hi @AdamWill Sorry it took a while to get back to you. I decided it might be cleaner to ignore the _name_, _value_, and _sort_order_ for Enums. I'm closing this PR since it will be addressed in a new PR I'm opening now. Thanks again for bringing this issue to my attention.

seperman avatar Aug 13 '22 23:08 seperman