call site 0 for compat.optparse.OptionGroup.set_description
test/rsession/testing/test_executor.py - line 140
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
   def test_apigen_executor(self):
       class Tracer(object):
           def __init__(self):
               self.starts = 0
               self.ends = 0
           
           def start_tracing(self):
               self.starts += 1
   
           def end_tracing(self):
               self.ends += 1
       
       tmpdir = py.test.ensuretemp("apigen_executor")
       tmpdir.ensure("__init__.py")
       tmpdir.ensure("test_one.py").write(py.code.Source("""
           def g():
               pass
       
           def test_1():
               g()
   
           class TestX(object):
               def setup_method(self, m):
                   self.ttt = 1
   
               def test_one(self):
                   self.ttt += 1
   
               def test_raise(self):
                   1/0
           """))
->     config = py.test.config._reparse([tmpdir])
       rootcol = config._getcollector(tmpdir)
       tracer = Tracer()
       item = rootcol._getitembynames("test_one.py/test_1")
       ex = ApigenExecutor(item, config=config)
       out1 = ex.execute(tracer)
       item = rootcol._getitembynames("test_one.py/TestX/()/test_one")
       ex = ApigenExecutor(item, config=config)
       out2 = ex.execute(tracer)
       item = rootcol._getitembynames("test_one.py/TestX/()/test_raise")
       ex = ApigenExecutor(item, config=config)
       out3 = ex.execute(tracer)
       assert tracer.starts == 3
       assert tracer.ends == 3
       assert out1.passed
       assert out2.passed
       assert not out3.passed
test/config.py - line 187
180
181
182
183
184
185
186
187
188
189
190
   def _reparse(self, args):
       """ this is used from tests that want to re-invoke parse(). """
       #assert args # XXX should not be empty
       global config_per_process
       oldconfig = py.test.config
       try:
           config_per_process = py.test.config = Config()
->         config_per_process.parse(args) 
           return config_per_process
       finally: 
           config_per_process = py.test.config = oldconfig 
test/config.py - line 45
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
   def parse(self, args): 
       """ parse cmdline arguments into this config object. 
               Note that this can only be called once per testing process. 
           """ 
       assert not self._initialized, (
               "can only parse cmdline args once per Config object")
       self._initialized = True
->     adddefaultoptions(self)
       self._conftest.setinitial(args) 
       args = [str(x) for x in args]
       cmdlineoption, args = self._parser.parse_args(args) 
       self.option.__dict__.update(vars(cmdlineoption))
       if not args:
           args.append(py.std.os.getcwd())
       self.topdir = gettopdir(args)
       self.args = args 
test/defaultconftest.py - line 73
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
   def adddefaultoptions(config):
       Option = config.Option 
       config._addoptions('general options',
           Option('-v', '--verbose',
                  action="count", dest="verbose", default=0,
                  help="increase verbosity."),
           Option('-x', '--exitfirst',
                  action="store_true", dest="exitfirst", default=False,
                  help="exit instantly on first error or failed test."),
           Option('-s', '--nocapture',
                  action="store_true", dest="nocapture", default=False,
                  help="disable catching of sys.stdout/stderr output."),
           Option('-k',
                  action="store", dest="keyword", default='',
                  help="only run test items matching the given (google-style) "
                       "keyword expression."),
           Option('-l', '--showlocals',
                  action="store_true", dest="showlocals", default=False,
                  help="show locals in tracebacks (disabled by default)."),
           Option('', '--pdb',
                  action="store_true", dest="usepdb", default=False,
                  help="start pdb (the Python debugger) on errors."),
           Option('', '--tb',
                  action="store", dest="tbstyle", default='long',
                  type="choice", choices=['long', 'short', 'no'],
                  help="traceback verboseness (long/short/no)."),
           Option('', '--fulltrace',
                  action="store_true", dest="fulltrace", default=False,
                  help="don't cut any tracebacks (default is to cut)."),
           Option('', '--nomagic',
                  action="store_true", dest="nomagic", default=False,
                  help="refrain from using magic as much as possible."),
           Option('', '--collectonly',
                  action="store_true", dest="collectonly", default=False,
                  help="only collect tests, don't execute them."),
           Option('', '--traceconfig',
                  action="store_true", dest="traceconfig", default=False,
                  help="trace considerations of conftest.py files."),
           Option('-f', '--looponfailing',
                  action="store_true", dest="looponfailing", default=False,
                  help="loop on failing test set."),
           Option('', '--exec',
                  action="store", dest="executable", default=None,
->                help="python executable to run the tests with."),
       )
   
       config._addoptions('EXPERIMENTAL options',
           Option('-d', '--dist',
                  action="store_true", dest="dist", default=False,
                  help="ad-hoc distribute tests across machines (requires conftest settings)"), 
           Option('-w', '--startserver',
                  action="store_true", dest="startserver", default=False,
                  help="starts local web server for displaying test progress.", 
                  ),
           Option('-r', '--runbrowser',
                  action="store_true", dest="runbrowser", default=False,
                  help="run browser (implies --startserver)."
                  ),
           Option('', '--boxed',
                  action="store_true", dest="boxed", default=False,
                  help="box each test run in a separate process"), 
           Option('', '--rest',
                  action='store_true', dest="restreport", default=False,
                  help="restructured text output reporting."),
           Option('', '--apigen',
                  action="store", dest="apigen",
                  help="generate api documentation while testing (requires "
                  "argument pointing to a script)."),
           Option('', '--session',
                  action="store", dest="session", default=None,
                  help="lookup given sessioname in conftest.py files and use it."), 
       )
test/config.py - line 117
116
117
118
119
120
121
122
123
   def _addoptions(self, groupname, *specs):
->     optgroup = optparse.OptionGroup(self._parser, groupname) 
       optgroup.add_options(specs) 
       self._parser.add_option_group(optgroup)
       for opt in specs: 
           if hasattr(opt, 'default') and opt.dest:
               setattr(self.option, opt.dest, opt.default) 
       return self.option
compat/optparse.py - line 1011
1008
1009
1010
1011
1012
   def __init__(self, parser, title, description=None):
       self.parser = parser
       OptionContainer.__init__(
->         self, parser.option_class, parser.conflict_handler, description)
       self.title = title
compat/optparse.py - line 866
857
858
859
860
861
862
863
864
865
866
   def __init__(self, option_class, conflict_handler, description):
       # Initialize the option list and related data structures.
       # This method must be provided by subclasses, and it must
       # initialize at least the following instance attributes:
       # option_list, _short_opt, _long_opt, defaults.
       self._create_option_list()
   
       self.option_class = option_class
       self.set_conflict_handler(conflict_handler)
->     self.set_description(description)