method: test.LSession.main

*Not documented*
    def main(self, args, reporter=None, runner=None, shouldstop=None):

origin: test.LSession

where:

exceptions that might appear during execution:

function source:

def main(self, args, reporter=None, runner=None, shouldstop=None):
    # check out if used options makes any sense
        
    if not args: 
        args = [py.path.local()]
        
    sshhosts = ['localhost'] # this is just an info to reporter
        
    if not self.config.option.nomagic:
        py.magic.invoke(assertion=1)

    session_options.bind_config(self.config)
    reporter, checkfun, startserverflag = self.init_reporter(reporter, 
        sshhosts, LocalReporter, args[0])
    if shouldstop:
        checkfun = shouldstop
        
    reporter(report.TestStarted(sshhosts))
    pkgdir = self.getpkgdir(args[0])
    colitems = self.make_colitems(args, baseon=pkgdir.dirpath())
    reporter(report.RsyncFinished())
        
    if runner is None and self.config.option.apigen:
        from py.__.apigen.tracer.tracer import Tracer
        # XXX
        module = py
        #module = __import__(str(pkgdir.join('__init__.py')))
        try:
            self.docstorage = self.config.getinitialvalue('ApiGen').get_doc_storage()
        except (ValueError, AttributeError):
            raise NotImplementedError("Need to provide conftest "
                "way of generating DocStorage")
        self.tracer = Tracer(self.docstorage)
        runner = apigen_runner
    #elif runner is None and (self.config.option.usepdb or self.config.option.nocapture):
    #    runner = plain_runner
    #elif runner is None:
    #    runner = box_runner
    elif runner is None:
        runner = RunnerPolicy[session_options.runner_policy]

    keyword = self.config.option.keyword

    def itemgen():
        for x in colitems: 
            for y in x.tryiter(reporterror = lambda x: self.reporterror(reporter, x), keyword = keyword):
                yield y 
        
    itemgenerator = itemgen() 
    #assert 0, "\n".join([",".join(x.listnames()) for x in 
    #    list(itemgenerator)])
    # XXX: We have to decide which runner to use at this point
    local_loop(self, reporter, itemgenerator, checkfun, self.config, runner=runner)
        
    reporter(report.TestFinished())
    if startserverflag:
        from py.__.test.rsession.web import kill_server
        kill_server()

    #py.test.Function.state.teardown_all()
    if not self.config.option.nomagic:
        py.magic.revoke(assertion=1)
        
    if self.config.option.apigen:
        try:
            self.config.getinitialvalue('ApiGen').write_docs(self.docstorage)
        except ValueError:
            raise NotImplementedError("Cannot create docs - didn't "
                "provided way of doing that in conftest")

call sites:

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.0

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.1

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.2

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.3

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.4

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.5

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.6

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.7

called in /home/johnny/projects/merlinux/py/dist/py/test/rsession/testing/test_lsession.py

traceback test.LSession.main.8