The optparse module is deprecated since Python 2.7/3.2 . Recommend usage of the argparse module which improves upon optparse.
tests: Port usage of deprecated optparse module to argparse module #13944
pull Kvaciral wants to merge 1 commits into bitcoin:master from Kvaciral:argparse_port changing 5 files +41 −41-
Kvaciral commented at 9:41 PM on August 11, 2018: contributor
- laanwj added the label Tests on Aug 11, 2018
-
in test/functional/example_test.py:73 in 24ae7d08b4 outdated
69 | @@ -70,7 +70,7 @@ def custom_function(): 70 | class ExampleTest(BitcoinTestFramework): 71 | # Each functional test is a subclass of the BitcoinTestFramework class. 72 | 73 | - # Override the set_test_params(), add_options(), setup_chain(), setup_network() 74 | + # Override the set_test_params(), add_arguments(), setup_chain(), setup_network()
MarcoFalke commented at 9:54 PM on August 11, 2018:All of our arguments are options, so our name of this method can be left untouched.
laanwj commented at 10:23 PM on August 11, 2018: memberutACK 5654efb187d24eb29a343c720e3937b01457c8b7
Ported usage of deprecated optparse module to argparse module 5654efb187promag commented at 12:04 AM on August 12, 2018: memberutACK 5654efb.
Kvaciral renamed this:test: Port usage of deprecated optparse module to argparse module
tests: Port usage of deprecated optparse module to argparse module
on Aug 12, 2018donaloconnor commented at 9:20 AM on August 12, 2018: contributorin test/functional/test_framework/test_framework.py:123 in 5654efb187
141 | + parser.add_argument("--pdbonfailure", dest="pdbonfailure", default=False, action="store_true", 142 | + help="Attach a python debugger if test fails") 143 | + parser.add_argument("--usecli", dest="usecli", default=False, action="store_true", 144 | + help="use bitcoin-cli instead of RPC for all commands") 145 | self.add_options(parser) 146 | - (self.options, self.args) = parser.parse_args()
domob1812 commented at 9:34 AM on August 12, 2018:I assume that no existing code relies on
self.args(as otherwise you would see test failures)?
laanwj commented at 9:43 AM on August 12, 2018:indeed, none of the code uses that as @MarcoFalke mentioned above, all the command-line arguments are options
domob1812 approveddomob1812 commented at 9:34 AM on August 12, 2018: contributorutACK 5654efb187d24eb29a343c720e3937b01457c8b7
fanquake commented at 9:45 AM on August 12, 2018: memberutACK 5654efb
laanwj merged this on Aug 12, 2018laanwj closed this on Aug 12, 2018laanwj referenced this in commit 0df7a6c13e on Aug 12, 2018UdjinM6 referenced this in commit ad8df421ad on Jul 4, 2021UdjinM6 referenced this in commit 93b8fe2452 on Jul 6, 2021UdjinM6 referenced this in commit aaf5235b78 on Jul 6, 2021MarcoFalke locked this on Sep 8, 2021Labels
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-28 06:15 UTC
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-28 06:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me