Re: [Zope-dev] test setup layer sorting

2009-07-14 Thread Reinout van Rees
On 2009-07-13, Marius Gedminas mar...@gedmin.as wrote: On Mon, Jul 13, 2009 at 12:27:50PM +, Reinout van Rees wrote: I my test files, I had two separate zcml files (one registered a bit more than the other). So I ended up with two separate ZCMLLayer subclasses. And both did some

Re: [Zope-dev] test setup layer sorting

2009-07-14 Thread Reinout van Rees
On 2009-07-13, Marius Gedminas mar...@gedmin.as wrote: zope.testing supports test layers that muck up the global state irrepairably (by letting the layer's tearDown method raise NotImplementedError) and continues running the subsequent test layers in a fresh and squeaky-clean subprocess.

Re: [Zope-dev] test setup layer sorting

2009-07-13 Thread Marius Gedminas
On Mon, Jul 13, 2009 at 09:27:54AM +, Reinout van Rees wrote: zope/testing/testrunner/runner.py's order_by_bases() function orders layers by inheritance, basically. So if you've got a FunctionalTestLayer that inherits from some BasicTestLayer, the tests that use the basic test layer will

Re: [Zope-dev] test setup layer sorting

2009-07-13 Thread Reinout van Rees
On 2009-07-13, Marius Gedminas mar...@gedmin.as wrote: Whatever grok does that interferes with coverage should be fixed. I did some more debugging. In the end it boils down to this: With z3c.testsetup, you can specify a zcml file at the top of your test file. z3c.testsetup creates a ZCMLLayer

Re: [Zope-dev] test setup layer sorting

2009-07-13 Thread Benji York
On Mon, Jul 13, 2009 at 5:55 AM, Marius Gedminasmar...@gedmin.as wrote: Personally I would much prefer for the unit test layer to be sorted first.  It is already treated specially by zope.testing; I see no harm in hardcoding its sort order. +1 -- Benji York Senior Software Engineer Zope

Re: [Zope-dev] test setup layer sorting

2009-07-13 Thread Marius Gedminas
On Mon, Jul 13, 2009 at 12:27:50PM +, Reinout van Rees wrote: On 2009-07-13, Marius Gedminas mar...@gedmin.as wrote: Whatever grok does that interferes with coverage should be fixed. I did some more debugging. In the end it boils down to this: With z3c.testsetup, you can specify a

Re: [Zope-dev] test setup layer sorting

2009-07-13 Thread Fred Drake
On Mon, Jul 13, 2009 at 3:36 PM, Marius Gedminasmar...@gedmin.as wrote: Fortunately, the NotImplementedError in ZCMLLayer's tearDown is just a precaution, 99% of the time it is sufficient to run CleanUp.tearDown to get the global state restored to its pristine condition. Keep in mind that a