smarie / python-pytest-harvest

Store data created during your `pytest` tests execution, and retrieve it at the end of the session, e.g. for applicative benchmarking purposes.
https://smarie.github.io/python-pytest-harvest/
BSD 3-Clause "New" or "Revised" License
61 stars 8 forks source link

Fix ResultsBag.__hash__() on 32 bit #27

Closed keszybz closed 4 years ago

keszybz commented 4 years ago

Fixes https://github.com/smarie/python-pytest-harvest/issues/26.

On 32 bit, id() returns an unsigned 32 bit integer, but Py_hash_t is signed 32 bit, so the result doesn't fit in the range of [-232, 232), and will get processed through the hash function for Py_Long to coerce into the expected range.

codecov-io commented 4 years ago

Codecov Report

Merging #27 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #27   +/-   ##
=======================================
  Coverage   94.75%   94.75%           
=======================================
  Files          28       28           
  Lines         915      915           
=======================================
  Hits          867      867           
  Misses         48       48
Impacted Files Coverage Δ
pytest_harvest/tests/test_results_bag_basic.py 100% <100%> (ø) :arrow_up:

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 ef11d3a...db856ba. Read the comment docs.

smarie commented 4 years ago

Quite cool, thanks for finding this ! (wondering HOW you ended up finding it... apart if testing open source libs on old machines is kind of your hobby ? ;) )

EDIT: nevermind, I just realized that it is not so rare to have 32bits VMs - I myself use an old linux mint 32 bit VM from time to time :)

keszybz commented 4 years ago

I'm packaging pytest-harvest and the test for Fedora with the intent of packaging fenics (https://bitbucket.org/fenics-project/fenics). We still have arm32 and i686 builders.

smarie commented 4 years ago

cool ! thanks for letting me know