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
  1. casey commented at 4:10 PM on July 22, 2015: contributor

    If two TestInstances are created without providing a list of objects, they'll be shared across both instances.

  2. Don't share objects between TestInstances 56b28fca46
  3. 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)

  4. laanwj added the label Tests on Jul 24, 2015
  5. laanwj merged this on Jul 24, 2015
  6. laanwj closed this on Jul 24, 2015

  7. laanwj referenced this in commit 410fd7448a on Jul 24, 2015
  8. luke-jr commented at 2:43 AM on September 20, 2015: member

    Nit: This doesn't actually fix the problem if objects is 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.

  9. casey deleted the branch on Sep 20, 2015
  10. zkbot referenced this in commit 57d420e2f8 on Feb 15, 2017
  11. zkbot referenced this in commit 88c209dba6 on Feb 20, 2017
  12. zkbot referenced this in commit dadb1ab74c on Mar 3, 2017
  13. DrahtBot locked this on Sep 8, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-02 03:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me