[py-dev] Running only previously failing tests

Grig Gheorghiu grig at gheorghiu.net
Mon Jul 18 22:26:48 CEST 2005


--- holger krekel <hpk at trillke.net> wrote:

> On Mon, Jul 18, 2005 at 10:57 -0700, Grig Gheorghiu wrote:
> > --- holger krekel <hpk at trillke.net> wrote:
> > 
> > > Hi Grig! 
> > > 
> > > On Mon, Jul 18, 2005 at 10:33 -0700, Grig Gheorghiu wrote:
> > > > I thought this was possible via 'py.test --session=terminal'
> for
> > > > example, but when I do that all the tests are run, not only the
> > > ones
> > > > that were previously failing. Am I doing something wrong?
> > > 
> > > Only the '--looponfailing' option does what you want.  It keeps
> > > the frontend process looping and waiting for file changes 
> > > in the project.  On such changes the failing tests are re-run
> > > in a second process.  The backend process reports to the
> > > frontend process the set of failing tests so that they
> > > can be memorized by the frontend process. 
> > 
> > OK, I knew about looponfailing....But as you say, looponfailing
> watches
> > for changes in all files. I thought there's an easier way to just
> tell
> > py.test to run previously failing tests. I guess it's a feature to
> add
> > to the list? 
> 
> Yes, it is. It requires some storage mechanism for py.test (and the
> py lib
> in general), for example a '.' directory in the home-directory of the
> user. 
> But it should work for win32 as well, of course.  I am not sure how
> you can construct a user specific directory.  Moreover, it should be
> safe
> against concurrent accesses e.g. from test sessions running at the
> same
> time.  This is not super-hard but it requires some thought and
> platform
> knowledge.  Once we have such a mechanism it becomes rather easy to
> rerun previously failing tests. 
> 

Hi, Holger

There are 2 environment variables in Windows that together give you a
user-specific directory: HOMEDRIVE and HOMEPATH. So that should not be
a problem. I think the harder part is the concurrent aspect. But I'm
sure we can figure something out on Windows once we have a reference
implementation on Unix.

Grig


More information about the py-dev mailing list