Fix docstrings in qa tests #9577

pull jnewbery wants to merge 1 commits into bitcoin:master from jnewbery:docstrings changing 89 files +389 −484
  1. jnewbery commented at 7:57 PM on January 18, 2017: member

    This commit adds module-level docstrings for the tests and helper modules in qa. Many of these tests were uncommented previously - this commit ensures that every test case has at least a minimum level of commenting.

    It also puts the module-level docstring in front of the imports.

  2. fanquake added the label Docs and Output on Jan 19, 2017
  3. laanwj commented at 7:00 AM on January 19, 2017: member

    Thanks for adding documentation. utACK

  4. MarcoFalke added this to the milestone 0.15.0 on Jan 20, 2017
  5. MarcoFalke added the label Tests on Jan 20, 2017
  6. MarcoFalke requested review from MarcoFalke on Jan 20, 2017
  7. fanquake commented at 11:52 PM on January 20, 2017: member

    utACK 077b626

  8. jtimon commented at 2:06 AM on February 1, 2017: contributor

    Fast review ACK 077b626

  9. laanwj commented at 4:27 PM on February 20, 2017: member

    Needs rebase

  10. jnewbery force-pushed on Feb 20, 2017
  11. jnewbery commented at 11:01 PM on February 20, 2017: member

    rebased

  12. laanwj commented at 4:40 PM on February 21, 2017: member

    @marcofalke you have tagged yourself as reviewer, this can be merged as soon as you are ok with it

  13. ryanofsky commented at 5:20 PM on February 21, 2017: member

    This does seem like an improvement that should be merged, though it would be nicer if it followed PEP257 to work better with pydoc.

    Main reason these strings don't look good in pydoc is they don't follow the guideline to begin with summary lines. A summary line is "a phrase ending in a period. It prescribes the function or method's effect as a command, not as a description." Instead they start with filenames. I think the filenames should be removed even if we don't want to take the time to write summary lines.

  14. jnewbery force-pushed on Feb 21, 2017
  15. jnewbery commented at 10:22 PM on February 21, 2017: member

    Thanks @ryanofsky . I've made the docstrings conform with PEP257. Can you check the pydocs again?

    I've also added docstrings for the modules that have been added since opening this PR.

  16. in qa/rpc-tests/create_cache.py:None in ccfe2b9956 outdated
       7 | -#
       8 | -# Helper script to create the cache
       9 | -# (see BitcoinTestFramework.setup_chain)
      10 | -#
      11 | +Creating a cache of the blockchain speeds up test execution when running
      12 | +multiple qa tests. This helper script is executed by rpc-tests when multipl
    


    MarcoFalke commented at 11:21 PM on February 21, 2017:

    missing a trailing e?

  17. in qa/rpc-tests/disablewallet.py:None in ccfe2b9956 outdated
       7 | -#
       8 | -# Exercise API with -disablewallet.
       9 | -#
      10 | +Tests:
      11 | +    - validateaddress RPC doesn't cause bitcoind to crash when running with -disablewallet
      12 | +    (https://github.com/bitcoin/bitcoin/issues/6963#issuecomment-154548880)
    


    MarcoFalke commented at 11:27 PM on February 21, 2017:

    I think it is not required to be so specific in the doc string. You can leave this link where it was or remove it alltogether.

    The test just checks if validateaddress works (even) with the wallet disabled. No need to mention "crash", imo.

  18. MarcoFalke approved
  19. MarcoFalke commented at 11:35 PM on February 21, 2017: member

    utACK mod 2 nits.

  20. jnewbery commented at 1:19 AM on February 22, 2017: member

    Thanks for the comments @MarcoFalke - I appreciate this isn't the most thrilling PR to review!

    Nits addressed. I will squash when ready to merge.

  21. MarcoFalke commented at 8:29 AM on February 22, 2017: member

    @jnewbery Thanks. ACK 82bc966 This is ready for squash.

  22. in qa/rpc-tests/smartfees.py:None in 82bc966aaa outdated
       1 | @@ -2,10 +2,7 @@
       2 |  # Copyright (c) 2014-2016 The Bitcoin Core developers
       3 |  # Distributed under the MIT software license, see the accompanying
       4 |  # file COPYING or http://www.opensource.org/licenses/mit-license.php.
       5 | -
       6 | -#
       7 | -# Test fee estimation code
       8 | -#
       9 | +""" Test fee estimation code.""" 
    


    ryanofsky commented at 2:49 PM on February 22, 2017:

    Trailing whitespace on this line.

  23. in qa/rpc-tests/test_framework/blockstore.py:None in 82bc966aaa outdated
      13 |  import dbm.dumb as dbmd
      14 |  
      15 |  class BlockStore(object):
      16 | +    """
      17 | +    BlockStore helper class.
      18 | +    
    


    ryanofsky commented at 2:52 PM on February 22, 2017:

    Trailing whitespace

  24. in qa/rpc-tests/test_framework/blockstore.py:None in 82bc966aaa outdated
       1 | @@ -2,16 +2,21 @@
       2 |  # Copyright (c) 2015-2016 The Bitcoin Core developers
       3 |  # Distributed under the MIT software license, see the accompanying
       4 |  # file COPYING or http://www.opensource.org/licenses/mit-license.php.
       5 | -# BlockStore: a helper class that keeps a map of blocks and implements
       6 | -#             helper functions for responding to getheaders and getdata,
       7 | -#             and for constructing a getheaders message
       8 | -#
       9 | +""" Provides BlockStore and TxStore helper classes. """
    


    ryanofsky commented at 2:53 PM on February 22, 2017:

    Unintentended space before close quote?

  25. ryanofsky commented at 3:02 PM on February 22, 2017: member

    Again this is already a big improvement as is, so utACK 82bc966aaa9c29555db90f638b3ae65a63d1941d.

    But consider running:

    sed -i 's/""" \+/"""/' *.py
    sed -i 's/\(Test\|Create\)s/\1/g' *.py
    

    to get rid of asymmetric spaces after opening quotes, and to fix verb tenses (commands, not descriptions) for pep257.

  26. Fix docstrings in qa tests
    This commit fixes the module-level docstrings for the tests and helper
    modules in qa. Many of these tests were uncommented previously - this
    commit ensures that every test case has at least a minimum level of
    commenting.
    3f95a806b1
  27. jnewbery force-pushed on Feb 23, 2017
  28. jnewbery commented at 3:31 PM on February 23, 2017: member

    Thanks @ryanofsky . Nits addressed and commits squashed. I think this is now ready to merge.

  29. MarcoFalke merged this on Feb 23, 2017
  30. MarcoFalke closed this on Feb 23, 2017

  31. MarcoFalke referenced this in commit d6064a89ac on Feb 23, 2017
  32. jnewbery deleted the branch on Feb 23, 2017
  33. luke-jr referenced this in commit 56ea8e7c6a on Jun 3, 2017
  34. PastaPastaPasta referenced this in commit b582f93545 on Dec 28, 2018
  35. PastaPastaPasta referenced this in commit 91449beef0 on Dec 29, 2018
  36. PastaPastaPasta referenced this in commit 22aac24df0 on Dec 29, 2018
  37. PastaPastaPasta referenced this in commit 91cf8336eb on Dec 29, 2018
  38. PastaPastaPasta referenced this in commit 73d8ce2d69 on Jan 2, 2019
  39. PastaPastaPasta referenced this in commit ccf356b226 on Jan 3, 2019
  40. PastaPastaPasta referenced this in commit 5bad2f10c7 on Jan 3, 2019
  41. UdjinM6 referenced this in commit 07dcddb4ca on Jan 7, 2019
  42. PastaPastaPasta referenced this in commit 395065f3b2 on Jan 7, 2019
  43. PastaPastaPasta referenced this in commit a86a1b6dc0 on Jan 25, 2019
  44. PastaPastaPasta referenced this in commit e79f00784e on Jan 29, 2019
  45. DrahtBot locked this on Sep 8, 2021
Labels

Milestone
0.15.0


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-18 21:15 UTC

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