test: Make test cases separate functions #16293

pull MarcoFalke wants to merge 2 commits into bitcoin:master from MarcoFalke:1906-testNoScopeLeak changing 1 files +92 −65
  1. MarcoFalke commented at 5:53 PM on June 26, 2019: member

    This prevents scope-leak of symbols that are supposed to be local to one test case.

  2. MarcoFalke commented at 5:53 PM on June 26, 2019: member
  3. DrahtBot added the label Tests on Jun 26, 2019
  4. MarcoFalke force-pushed on Jun 26, 2019
  5. practicalswift commented at 6:19 PM on June 26, 2019: contributor

    Concept ACK

  6. gwillen commented at 7:40 PM on June 27, 2019: contributor

    This seems like a great direction to go! There's probably more we can do in terms of managing state that's shared between test cases, but just explicitly spelling out which state is shared with self.foo, and unsharing other state, is going to remove 90% of the footgun potential right off the top.

  7. DrahtBot commented at 4:23 AM on June 28, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  8. in test/functional/rpc_fundrawtransaction.py:118 in 1111451d1e outdated
     113 | @@ -84,6 +114,7 @@ def run_test(self):
     114 |          self.nodes[0].generate(1)
     115 |          self.sync_all()
     116 |  
     117 | +    def test_simple(self):
     118 |          ###############
    


    promag commented at 2:43 PM on June 28, 2019:

    nit, could nuke these "boxes".

  9. promag commented at 2:47 PM on June 28, 2019: member

    ACK 1111451d1, could squash last commit.

  10. MarcoFalke force-pushed on Jun 28, 2019
  11. jonatack commented at 2:43 PM on June 29, 2019: member

    Concept ACK, am updating #15687 to this as well after your review comment. Perhaps document where tests are order-dependent, if any. Will review.

  12. DrahtBot added the label Needs rebase on Jul 1, 2019
  13. test: Make local symbols in run_test members fa6fba3bc8
  14. test: Split fundrawtx test into subtests faf8318c55
  15. MarcoFalke force-pushed on Jul 2, 2019
  16. MarcoFalke commented at 9:20 PM on July 2, 2019: member

    Rebased due to conflict in adjacent line

  17. DrahtBot removed the label Needs rebase on Jul 3, 2019
  18. MarcoFalke merged this on Jul 31, 2019
  19. MarcoFalke closed this on Jul 31, 2019

  20. MarcoFalke referenced this in commit 5639d71a07 on Jul 31, 2019
  21. MarcoFalke deleted the branch on Jul 31, 2019
  22. sidhujag referenced this in commit f99badd13e on Aug 1, 2019
  23. jasonbcox referenced this in commit d54de8344d on Sep 30, 2020
  24. Munkybooty referenced this in commit 68d45836ae on Nov 17, 2021
  25. Munkybooty referenced this in commit a7fc5ab12b on Nov 17, 2021
  26. Munkybooty referenced this in commit 9622ce5cb3 on Nov 17, 2021
  27. Munkybooty referenced this in commit 96f21a556e on Nov 18, 2021
  28. Munkybooty referenced this in commit 436f48f90b on Nov 24, 2021
  29. Munkybooty referenced this in commit 3591b6bc47 on Nov 30, 2021
  30. Munkybooty referenced this in commit af863803bc on Dec 15, 2021
  31. DrahtBot locked this on Dec 16, 2021

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-04-17 06:14 UTC

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