call site 2 for compat.optparse.OptionContainer.__init__
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 186
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 34
31
32
33
34
35
36
   def __init__(self): 
       self.option = CmdOptions()
       self._parser = optparse.OptionParser(
->         usage="usage: %prog [options] [query] [filenames of tests]")
       self._conftest = Conftest()
       self._initialized = False
compat/optparse.py - line 1107
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
   def __init__(self,
                usage=None,
                option_list=None,
                option_class=Option,
                version=None,
                conflict_handler="error",
                description=None,
                formatter=None,
                add_help_option=True,
                prog=None):
       OptionContainer.__init__(
->         self, option_class, conflict_handler, description)
       self.set_usage(usage)
       self.prog = prog
       self.version = version
       self.allow_interspersed_args = True
       self.process_default_values = True
       if formatter is None:
           formatter = IndentedHelpFormatter()
       self.formatter = formatter
       self.formatter.set_parser(self)
   
       # Populate the option list; initial sources are the
       # standard_option_list class attribute, the 'option_list'
       # argument, and (if applicable) the _add_version_option() and
       # _add_help_option() methods.
       self._populate_option_list(option_list,
                                  add_help=add_help_option)
   
       self._init_parsing_state()