call site 3 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 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 79
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."), 
       )