summaryrefslogtreecommitdiff
path: root/test/test_program.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_program.py')
-rw-r--r--test/test_program.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/test_program.py b/test/test_program.py
index c29599e..d5fa015 100644
--- a/test/test_program.py
+++ b/test/test_program.py
@@ -4,12 +4,19 @@ import pytest
from ruamel.std.argparse import ProgramBase, option, sub_parser, version
class Program(ProgramBase):
+ def __init__(self):
+ ProgramBase.__init__(self)
+
+ # you can put these options on __init__, but if Program is going
+ # to be subclassed, there will be another __init__ scanned
+ # in ProgramBase.__init__ than the one decorated here
+ # defensive is to use a differently named option or the special _pb_init
@option('--verbose', global_option=True, action='store_true')
@option('--quiet', action='store_true')
#@option('--version', action='version', version='version: 42')
@version('version: 42')
- def __init__(self):
- ProgramBase.__init__(self)
+ def _pb_init(self):
+ pass
@sub_parser(help="call mercurial")
@option('--show', action='store_true')