Skip to content

Commit

Permalink
test_RefPat.py: Fix test from size difference
Browse files Browse the repository at this point in the history
Refpat seems also sorted by size. Though I'm not sure which comes
first when both entries are at the same size.

For #41
  • Loading branch information
zhuyifei1999 committed May 13, 2023
1 parent 8078a7a commit f42bec4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions guppy/heapy/test/test_RefPat.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,13 @@ class A:
gc.collect()
rp = self.rp(dst, src, depth=10)
rp.mod.View._is_clear_drg_enabled = 0 # Note Apr 19 2005
self.asis(rp.a.theone, b)
self.asis(rp.b.theone, a.__dict__)

if sys.getsizeof(b) > sys.getsizeof(a.__dict__):
self.asis(rp.a.theone, b)
self.asis(rp.b.theone, a.__dict__)
else:
self.asis(rp.a.theone, a.__dict__)
self.asis(rp.b.theone, b)

# Test that the dict is eventually automatically removed from dictowners -
# First test that dictowners is nonzero
Expand Down

0 comments on commit f42bec4

Please sign in to comment.