[py-dev] py.test and darcs
Michael Twomey
micktwomey at gmail.com
Mon May 2 16:51:01 CEST 2005
That worked a treat, thanks.
Michael
On 5/2/05, Jan Balster <jan at balster.info> wrote:
> Michael Twomey wrote:
> > Hi,
> >
> > I've been setting up a new pet project using py.test as the testing
> > framework, and darcs as the scm. I've hit a problem after my first
> > "darcs record" (darcs checkin). Darcs keeps a copy of the checked out
> > originals under a _darcs directory in the root of the source tree,
> > which causes py.test some confusion during the collect phase, since it
> > has duplicate python modules to contend with.
> >
> > Ideally I'd like py.test to ignore _darcs (and I think {arch} for GNU
> > arch too) out of the box, but is there a way to twist conftest.py's
> > arm to make it ignore these directories?
>
> Create a conftest.py with this content:
> ########################################################################
> import py
> class ExcludeDarcsDirectory(py.test.collect.Directory):
> def recfilter(self, path):
> return not path.check(fnmatch="_darcs*") and path.check(dotfile=0)
>
> Directory = ExcludeDarcsDirectory
> ########################################################################
>
> You can find a more sophisticated example of a custom Collector in
> py/documentation/conftest.py.
>
> Have a nice day
> Jan
>
> _______________________________________________
> py-dev mailing list
> py-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/py-dev
>
More information about the py-dev
mailing list