If two TestInstances are created without providing a list of objects, they'll be shared across both instances.
Don't share objects between TestInstances #6465
pull casey wants to merge 1 commits into bitcoin:master from casey:test-instance-objects-sharing-bug changing 1 files +2 −2-
casey commented at 4:10 PM on July 22, 2015: contributor
-
Don't share objects between TestInstances 56b28fca46
-
laanwj commented at 8:58 AM on July 24, 2015: member
Good catch. ACK. (luckily this case doesn't ever trigger as only one test instance is created per test, but still)
- laanwj added the label Tests on Jul 24, 2015
- laanwj merged this on Jul 24, 2015
- laanwj closed this on Jul 24, 2015
- laanwj referenced this in commit 410fd7448a on Jul 24, 2015
-
luke-jr commented at 2:43 AM on September 20, 2015: member
Nit: This doesn't actually fix the problem if
objectsis passed as a parameter. It would be better as:self.blocks_and_transactions = list(objects)...or maybe a deep-copy.
But maybe callers would want shared objects in some cases?
Without a real use case, it's hard to know what behaviour is sane here.
- casey deleted the branch on Sep 20, 2015
- zkbot referenced this in commit 57d420e2f8 on Feb 15, 2017
- zkbot referenced this in commit 88c209dba6 on Feb 20, 2017
- zkbot referenced this in commit dadb1ab74c on Mar 3, 2017
- DrahtBot locked this on Sep 8, 2021