call site 0 for compat.optparse.OptionParser.check_values
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 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 1282
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)