[TIP] nose/py.test plugins

holger krekel holger at merlinux.eu
Tue Nov 24 09:47:36 PST 2009

Hi Ross,

On Fri, Nov 20, 2009 at 12:30 +0000, Ross Lawley wrote:
> Hi,
> Thanks for the heads up about the repository.  I wasn't too sure what the
> situation was with bitbucket as I'm new to hg, but seems very similar to
> github work flows so all good there!  I found a good hg manual:
> http://hgbook.red-bean.com/
> Anyway, I've branched off coveragepy and created a repo:
> http://bitbucket.org/rozza/coverage-test-runner/

> I've added runner.py which is a utility wrapper for test plugins.  I've
> written a pytest and a nose plugin, I've use the pytest one locally with my
> codebase and it works great.  I've tested the nose plugin but haven't
> actually used it in anger - so it may need tweaking!
> Any feedback let me know - I'm not sure on the option parsing - you'll see
> why!

* options should be added in an explicit order (putting them on 
  a class randomizes the order).

* with the py.test-1.1.1 is it now possible to register a plugin
  via a "pytest11" setuptools entry point.   Nose has such a 
  mechanism as well, so we should use this for integration
  with the tools. 

* with py.test coverage is always run, we probably need some 
  "--cover" option which defaults to False and does not do
  any coverage changes.

I've implemented a diff that addresses the two last points. 
see the attachment. 


> Another area of note is I've tweaked the file / code omit code:
> 1) So that I can use a file with each rule on a line or command line comma
> separated as normal
> 2) I've moved the code_unit_factory file omit logic round so I could monkey
> patch it which is in the plugins - so remove that if you don't need it!  I
> know its not ideal it scratched my itch at the moment.
> Basically it means I can have a file in my repo that is used to filter all
> files on all work environments (mac osx / unix) eg:
> conftest
> /tests/
> /usr/lib/python.*/.*.py
> /usr/local/lib/python.*/.*.py
> /usr/share/*
> /var/lib/python-support/.*
> /System/Library/*
> /Library/*
> /opt/subversion/*
> .*.html
> /tests/
> Which seems more suited to running a test suite.
> Ross

> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rozza-coverage.diff
Type: text/x-diff
Size: 3362 bytes
Desc: not available
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20091124/0bad3c9c/attachment.diff>

More information about the testing-in-python mailing list