call site 8 for compat.optparse.make_option.__init__
doc/test_conftest.py - line 17
8
9
10
11
12
13
14
15
16
17
18
19
20
21
   def test_doctest_extra_exec(): 
       # XXX get rid of the next line: 
       py.magic.autopath().dirpath('conftest.py').copy(tmpdir.join('conftest.py'))
       xtxt = tmpdir.join('y.txt')
       xtxt.write(py.code.Source("""
           hello::
               .. >>> raise ValueError 
                  >>> None
       """))
->     config = py.test.config._reparse([xtxt]) 
       session = config.initsession()
       session.main()
       l = session.getitemoutcomepairs(Failed) 
       assert len(l) == 1
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 1123
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()
compat/optparse.py - line 1153
1145
1146
1147
1148
1149
1150
1151
1152
1153
   def _populate_option_list(self, option_list, add_help=True):
       if self.standard_option_list:
           self.add_options(self.standard_option_list)
       if option_list:
           self.add_options(option_list)
       if self.version:
           self._add_version_option()
       if add_help:
->         self._add_help_option()
compat/optparse.py - line 1138
1135
1136
1137
1138
   def _add_help_option(self):
       self.add_option("-h", "--help",
                       action="help",
->                     help=_("show this help message and exit"))
compat/optparse.py - line 930
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
   def add_option(self, *args, **kwargs):
       """add_option(Option)
              add_option(opt_str, ..., kwarg=val, ...)
           """
       if type(args[0]) is types.StringType:
->         option = self.option_class(*args, **kwargs)
       elif len(args) == 1 and not kwargs:
           option = args[0]
           if not isinstance(option, Option):
               raise TypeError, "not an Option instance: %r" % option
       else:
           raise TypeError, "invalid arguments"
   
       self._check_conflict(option)
   
       self.option_list.append(option)
       option.container = self
       for opt in option._short_opts:
           self._short_opt[opt] = option
       for opt in option._long_opts:
           self._long_opt[opt] = option
   
       if option.dest is not None:     # option has a dest, we need a default
           if option.default is not NO_DEFAULT:
               self.defaults[option.dest] = option.default
           elif not self.defaults.has_key(option.dest):
               self.defaults[option.dest] = None
   
       return option