[TIP] testing unittest2 plugin branch Was: How to get coverage.py and unittest2 working together?
jorge.vargas at gmail.com
Wed Jul 28 19:53:05 PDT 2010
On Wed, Jul 28, 2010 at 7:15 PM, Michael Foord
<fuzzyman at voidspace.org.uk> wrote:
> On 28/07/2010 22:41, Jorge Vargas wrote:
>> On Wed, Jul 28, 2010 at 5:29 PM, Michael Foord
>> <fuzzyman at voidspace.org.uk> wrote:
>>> On 28/07/2010 21:49, Jorge Vargas wrote:
>>>>> On 22/07/2010 21:02, Tim Hatch wrote:
>>>>> For what it's worth I'm now prototyping the extension mechanism for
>>>>> unittest/unittest2. Anyone who wants to follow along can look at the
>>>>> "plugins" branch of the repository at http://hg.python.org/unittest2
>>> Thanks - as I'm prototyping this it isn't tested yet - as you can tell.
>>> is fixed though. It is nearly in a condition where I can write it up for
>>> this mailing list and python-dev. I expect it to still change, but I've
>>> discussing it with Jason Pellerin who reports that the system is
>>> fine for "nose2" and he is porting a couple of the nose plugins to it.
>>> very interested in feedback.
>> I have been looking at the code and it does seems good enough. I like
>> how easy writing a plugin looks.
>> I'm working this on my day job and at this point I can't live without
>> coverage reports (I'm up to 30%!), so I can commit to test this daily,
>> also several others plugins that I may need, perhaps I can even write
>> patches :D although I don't know this codebase at all....
> I've pushed a few fixes for the coverage module in particular, so you should
> update (and report any *new* problems).
Seems like there is a problem with the event, as it is not triggering?
File "......./src/unittest2/unittest2/plugins/testcoverage.py", line
77, in stopTestRun
AttributeError: 'CoveragePlugin' object has no attribute 'cov'
>> for example the pdb plugin is currently not working as it's putting
>> the stop in inside unittest2, it is also doing funny things when
>> enabled together with checker :)
> It seems to work fine for me - even with the checker enabled. It is possible
> that one of my recent changes fixed it again :-o Could you try it again?
That indeed fixed it, even for
always-on = True
> Hmm... although if the error or the failure exception is raised inside
> unittest2 code - rather than directly in your code - the debugger plugin
> will drop you into the frame where the exception was raised, and not
> necessarily inside your own code. This is something that could be improved.
> In the meantime you can just type u <enter> to go up frames until you return
> to your code.
This is also fixed! awesome :)
>> another minor thing is that I think report-html = False as you will
>> get normal "to the shell reports" just like nose default.
> The coverage plugins needs more command line options to configure it. I'll
> change the default in the example unittest.cfg to report-html = False
indeed, although the other defaults seem good.
>> anyway it does looks really nice and I'm going to live on the edge
>> here so fell free to ping me :)
> Hehe, cool but unwise. ;-)
I can still hg up to an older version :p
More information about the testing-in-python