call site 0 for compat.optparse.Values.__init__
test/rsession/testing/test_lsession.py - line 123
106
107
108
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
   def test_minus_x(self):
       if not hasattr(py.std.os, 'fork'):
           py.test.skip('operating system not supported')
       tmpdir = tmp
       subdir = "sub_lsession_minus_x"
       tmpdir.ensure(subdir, "__init__.py")
       tmpdir.ensure(subdir, "test_one.py").write(py.code.Source("""
               def test_1(): 
                   pass
               def test_2():
                   assert 0
               def test_3():
                   raise ValueError(23)
               def test_4(someargs):
                   pass
           """))
       args = [str(tmpdir.join(subdir)), '-x']
->     config = py.test.config._reparse(args)
       assert config.option.exitfirst
       lsession = LSession(config)
       allevents = []
           
       lsession.main(reporter=allevents.append, runner=box_runner)
       testevents = [x for x in allevents 
                       if isinstance(x, repevent.ReceivedItemOutcome)]
       assert len(testevents)
       passevents = [i for i in testevents if i.outcome.passed]
       failevents = [i for i in testevents if i.outcome.excinfo]
       assert len(passevents) == 1
       assert len(failevents) == 1
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 48
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 
compat/optparse.py - line 1261
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
   def parse_args(self, args=None, values=None):
       """
           parse_args(args : [string] = sys.argv[1:],
                      values : Values = None)
           -> (values : Values, args : [string])
   
           Parse the command-line options found in 'args' (default:
           sys.argv[1:]).  Any errors result in a call to 'error()', which
           by default prints the usage message to stderr and calls
           sys.exit() with an error message.  On success returns a pair
           (values, args) where 'values' is an Values instance (with all
           your option values) and 'args' is the list of arguments left
           over after parsing options.
           """
       rargs = self._get_args(args)
       if values is None:
->         values = self.get_default_values()
   
       # Store the halves of the argument list as attributes for the
       # convenience of callbacks:
       #   rargs
       #     the rest of the command-line (the "r" stands for
       #     "remaining" or "right-hand")
       #   largs
       #     the leftover arguments -- ie. what's left after removing
       #     options and their arguments (the "l" stands for "leftover"
       #     or "left-hand")
       self.rargs = rargs
       self.largs = largs = []
       self.values = values
   
       try:
           stop = self._process_args(largs, rargs, values)
       except (BadOptionError, OptionValueError), err:
           self.error(err.msg)
   
       args = largs + rargs
       return self.check_values(values, args)
compat/optparse.py - line 1208
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
   def get_default_values(self):
       if not self.process_default_values:
           # Old, pre-Optik 1.5 behaviour.
           return Values(self.defaults)
   
       defaults = self.defaults.copy()
       for option in self._get_all_options():
           default = defaults.get(option.dest)
           if isinstance(default, basestring):
               opt_str = option.get_opt_string()
               defaults[option.dest] = option.check_value(opt_str, default)
   
->     return Values(defaults)