[svn r62245] fixed more wrong renames, fine-tuning
--HG-- branch : trunk
This commit is contained in:
parent
27110ea361
commit
82044fd873
|
@ -1,5 +1,3 @@
|
||||||
from __future__ import generators
|
|
||||||
|
|
||||||
import py
|
import py
|
||||||
from conftesthandle import Conftest
|
from conftesthandle import Conftest
|
||||||
|
|
||||||
|
@ -159,19 +157,19 @@ class Config(object):
|
||||||
|
|
||||||
def initsession(self):
|
def initsession(self):
|
||||||
""" return an initialized session object. """
|
""" return an initialized session object. """
|
||||||
cls = self._getestdirclass()
|
cls = self._getsessionclass()
|
||||||
session = cls(self)
|
session = cls(self)
|
||||||
session.fixoptions()
|
session.fixoptions()
|
||||||
return session
|
return session
|
||||||
|
|
||||||
def _getestdirclass(self):
|
def _getsessionclass(self):
|
||||||
""" return Session class determined from cmdline options
|
""" return Session class determined from cmdline options
|
||||||
and looked up in initial config modules.
|
and looked up in initial config modules.
|
||||||
"""
|
"""
|
||||||
if self.option.session is not None:
|
if self.option.session is not None:
|
||||||
return self._conftest.rget(self.option.session)
|
return self._conftest.rget(self.option.session)
|
||||||
else:
|
else:
|
||||||
name = self._getestdirname()
|
name = self._getsessionname()
|
||||||
try:
|
try:
|
||||||
return self._conftest.rget(name)
|
return self._conftest.rget(name)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -180,7 +178,7 @@ class Config(object):
|
||||||
mod = __import__(importpath, None, None, '__doc__')
|
mod = __import__(importpath, None, None, '__doc__')
|
||||||
return getattr(mod, name)
|
return getattr(mod, name)
|
||||||
|
|
||||||
def _getestdirname(self):
|
def _getsessionname(self):
|
||||||
""" return default session name as determined from options. """
|
""" return default session name as determined from options. """
|
||||||
if self.option.collectonly:
|
if self.option.collectonly:
|
||||||
name = 'Session'
|
name = 'Session'
|
||||||
|
|
|
@ -31,11 +31,10 @@ class LooponfailingSession(Session):
|
||||||
while 1:
|
while 1:
|
||||||
self.loop_once(loopstate)
|
self.loop_once(loopstate)
|
||||||
if not loopstate.colitems and loopstate.wasfailing:
|
if not loopstate.colitems and loopstate.wasfailing:
|
||||||
continue # rerun immediately
|
continue # the last failures passed, let's rerun all
|
||||||
self.statrecorder.waitonchange(checkinterval=2.0)
|
self.statrecorder.waitonchange(checkinterval=2.0)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print
|
print
|
||||||
pass
|
|
||||||
|
|
||||||
def loop_once(self, loopstate):
|
def loop_once(self, loopstate):
|
||||||
colitems = loopstate.colitems
|
colitems = loopstate.colitems
|
||||||
|
|
|
@ -120,4 +120,4 @@ def importplugin(importspec):
|
||||||
try:
|
try:
|
||||||
return __import__("py.__.test.plugin.%s" %(importspec), None, None, '__doc__')
|
return __import__("py.__.test.plugin.%s" %(importspec), None, None, '__doc__')
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError(importspec)
|
return __import__(importspec) # show the original exception
|
||||||
|
|
Loading…
Reference in New Issue