On Tuesday 17 October 2006 14:47, Jim Fulton wrote:
> You do realize that you can stack demo storages.
> Create a demo storage for the layer and test and
> toss the database when you're done. Look at the way
> zope.app.testing.functional works for an example.
Yep, we utilize that functional setup
Jim Fulton wrote:
You do realize that you can stack demo storages.
Would I be torturing myself like this if I did? ;-)
Create a demo storage for the layer and test and
toss the database when you're done. Look at the way
zope.app.testing.functional works for an example.
Yay! Thankyou :-)
c
Chris Withers wrote:
Jim Fulton wrote:
Each layer drops a savepoint in setUp and then rolls it back it in
tearDown. Likewise, the TestCase's setUp would drop a savepoint and
the tearDown would roll back to it.
This is a risky approach. If you have any software that does actual
commits,
you
Paul Winkler wrote:
Is this a bug in Philipp's article or in the testrunner?
I noticed the same thing when I wrote my zopewiki page
(http://zopewiki.org/TestLayersHowTo)
but it looks like new-style classes should work now,
judging by this svn log message:
"""
r68925 | Zen | 2006-06-30 07:49:37
Jim Fulton wrote:
Each layer drops a savepoint in setUp and then rolls it back it in
tearDown. Likewise, the TestCase's setUp would drop a savepoint and
the tearDown would roll back to it.
This is a risky approach. If you have any software that does actual
commits,
you'll be hosed.
Not su
Chris Withers wrote:
Hi all,
(sorry if some of this is Zope 2 - ish, the thread kinda started here
and the underlying bits of this are certainly relevant to Zope 3)
As you may have guessed by the flurry of mails today, I've been
refactoring a 2000 test suite to use layers.
I was hoping to
On Oct 17, 2006, at 12:01 PM, Chris Withers wrote:
So I'm left what the actual use for savepoints is
1) you want to reduce your memory usage within a transaction
2) a) sometimes you want to roll back to a certain point in a
transaction. b) sometimes you do this in a context of an assemble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Chris Withers wrote:
> Hi all,
>
> (sorry if some of this is Zope 2 - ish, the thread kinda started here
> and the underlying bits of this are certainly relevant to Zope 3)
>
> As you may have guessed by the flurry of mails today, I've been
> refacto
On Tue, Oct 17, 2006 at 11:30:46AM +0100, Chris Withers wrote:
> Hi All,
>
> It would appear that Philipp's article is somewhat misleading in that
> layers can't be new style classes...
>
> class MyLayer(object):
>
>def setUp(self): pass
>
>def tearDown(self): pass
>
> ..results in th
On Tue, Oct 17, 2006 at 05:40:51PM +0100, Chris Withers wrote:
> Philipp von Weitershausen wrote:
> >>?
> >
> >No. Who said you should do that?
>
> http://zopewiki.org/TestLayersHowTo
... and more authoritatively, a number of tests in zope/testing/testrunner-ex
use strings. Prior to the introduct
Philipp von Weitershausen wrote:
?
No. Who said you should do that?
http://zopewiki.org/TestLayersHowTo
Will a string even work?
Yes.
Chris - anyway, right now I'm more annoyed that savepoints are
sllooo and DemoStorage doesn't support undo... help with either
would be much appreci
Chris Withers wrote:
Philipp von Weitershausen wrote:
Chris Withers wrote:
Philipp von Weitershausen wrote:
What do I put in place of the ? to get hold of the layer's app?
self.layer.app
but self.layer is a string, no?
Huh? No, it's the layer object (e.g. the class)
even if you do:
cl
Philipp von Weitershausen wrote:
Chris Withers wrote:
Philipp von Weitershausen wrote:
What do I put in place of the ? to get hold of the layer's app?
self.layer.app
but self.layer is a string, no?
Huh? No, it's the layer object (e.g. the class)
even if you do:
class MyTests(TestCase):
Chris Withers wrote:
Philipp von Weitershausen wrote:
What do I put in place of the ? to get hold of the layer's app?
self.layer.app
but self.layer is a string, no?
Huh? No, it's the layer object (e.g. the class)
___
Zope3-dev mailing list
Zope3
Philipp von Weitershausen wrote:
What do I put in place of the ? to get hold of the layer's app?
self.layer.app
but self.layer is a string, no?
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
___
Chris Withers wrote:
Hi (yet) again ;-)
class MyLayer:
@classmethod
def setUp(self):
self.app = Testing.ZopeTestCase.Zope2.app()
@classmethod
def tearDown(self):
Testing.ZopeTestCase.close()
Shrug! That will modify the class! "self" is the class here (it's
convention to call
Hi all,
(sorry if some of this is Zope 2 - ish, the thread kinda started here
and the underlying bits of this are certainly relevant to Zope 3)
As you may have guessed by the flurry of mails today, I've been
refactoring a 2000 test suite to use layers.
I was hoping to use savepoints to spee
Chris Withers wrote:
Jim Fulton wrote:
I may have spoken too soon. It looks like there is code to
handle the object-as-base case in the test runner, at least on the trunk.
Perhaps the version used by zope3 doesn't handle this case, or
perhaps there's a bug that needs to be pursued.
That'd exp
whit wrote:
there is also a version of ztc by layers for 2.9(see zope2 branches)
Which branch exactly?
I'm using 2.9.4 and can't see any evidence of layers...
Chris
--
Simplistix - Content Management, Zope & Python Consulting
- http://www.simplistix.co.uk
_
Jim Fulton wrote:
I may be missing some then... which narratives are you thinking of?
You cited 3 in your note.
I'd like there to be a good narrative that actually ships in
zope.testing, I'm willing to do the work to make that happen provided I
can get some help on writing the doctest of zo
Jim Fulton wrote:
I may have spoken too soon. It looks like there is code to
handle the object-as-base case in the test runner, at least on the trunk.
Perhaps the version used by zope3 doesn't handle this case, or
perhaps there's a bug that needs to be pursued.
That'd explain it, I'm using 2.9
Chris Withers wrote:
Jim Fulton wrote:
Am I right in assuming that there aren't any good narrative docs for
test layers?
This is obviously in the eye of the beholder. I'm sure the people
who created narratives tried to do a good job. Perhaps you can do better.
I may be missing some then...
Jim Fulton wrote:
Chris Withers wrote:
Hi All,
It would appear that Philipp's article is somewhat misleading in that
layers can't be new style classes...
class MyLayer(object):
def setUp(self): pass
def tearDown(self): pass
..results in the following when used as a layer:
Attribute
Hi (yet) again ;-)
class MyLayer:
@classmethod
def setUp(self):
self.app = Testing.ZopeTestCase.Zope2.app()
@classmethod
def tearDown(self):
Testing.ZopeTestCase.close()
class MyTests(TestCase):
def setUp(self):
self.savepoint = transaction.savepoint()
self.app = mak
Jim Fulton wrote:
A layer is simply an object that has __module__, __name__, and __bases__
attributes and that has setUp and tearDown methods. That's it. You
can achieve that any way you want. I regret the use of the __bases__
attribute. It would have been better if I had left it up to layer
Jim Fulton wrote:
Am I right in assuming that there aren't any good narrative docs for
test layers?
This is obviously in the eye of the beholder. I'm sure the people
who created narratives tried to do a good job. Perhaps you can do better.
I may be missing some then... which narratives are y
Chris Withers wrote:
Hi All,
It would appear that Philipp's article is somewhat misleading in that
layers can't be new style classes...
class MyLayer(object):
def setUp(self): pass
def tearDown(self): pass
..results in the following when used as a layer:
AttributeError: type object
Martin Aspeli wrote:
Layers are ... layered. If your test base class has layer X and a test case
subclass of that has layer Y, then it will set up X, run all the X tests,
then setup Y and run all the Y and X&Y tests, then tear down Y and then X.
I didn't mention subclassing tests. Personally,
Chris Withers wrote:
Hi All,
Am I right in assuming that there aren't any good narrative docs for
test layers?
This is obviously in the eye of the beholder. I'm sure the people
who created narratives tried to do a good job. Perhaps you can do better.
...
Now, related to this, say I have co
Chris Withers wrote:
>
> Now, related to this, say I have content objects X and Y, which are
> expensive to set up. I have LayerX which sets up a sample content object
> X, and LayerY which does the same for content object Y. This is fine for
> tests which need one or other content type, but
Hi Chris.
Look at z3c.sampledata.layer, I provide a testlayer there.
Maybe you need to provide the __bases__!
Jürgen
Chris Withers wrote:
Hi All,
It would appear that Philipp's article is somewhat misleading in that
layers can't be new style classes...
class MyLayer(object):
def setUp
Stefan H. Holek wrote:
IIRC you need
@classmethod
def setUp(cls):
pass
@classmethod
def tearDown(cls):
pass
Sorry, braino on my part. Yes, I have the @classmethod's and I still see
the error:
AttributeError: type object 'object' has no attribute 'setUp'
c
IIRC you need
@classmethod
def setUp(cls):
pass
@classmethod
def tearDown(cls):
pass
On 17. Okt 2006, at 12:30, Chris Withers wrote:
It would appear that Philipp's article is somewhat misleading in
that layers can't be new style classes...
class MyLayer(obj
Hi All,
It would appear that Philipp's article is somewhat misleading in that
layers can't be new style classes...
class MyLayer(object):
def setUp(self): pass
def tearDown(self): pass
..results in the following when used as a layer:
AttributeError: type object 'object' has no attrib
Hi All,
Am I right in assuming that there aren't any good narrative docs for
test layers?
I've read the relevant text files in zope.testing but am none the wiser...
I found an article of Philipp's here which helped a bit:
http://www.z3lab.org/sections/blogs/philipp-weitershausen/2006_03_10_d
The Buildbot has detected a failed build of Zope3 trunk 2.4 Linux tlotze.
Buildbot URL: http://buildbot.zope.org/
Build Reason: changes
Build Source Stamp: 8227
Blamelist: ctheune
BUILD FAILED: failed test
sincerely,
-The Buildbot
___
Zope3-dev mail
The Buildbot has detected a failed build of Zope3 trunk 2.4 Linux tlotze.
Buildbot URL: http://buildbot.zope.org/
Build Reason: changes
Build Source Stamp: 8226
Blamelist: ctheune,jim,philikon,sidnei,tseaver,whitmo,wosc
BUILD FAILED: failed test
sincerely,
-The Buildbot
__
37 matches
Mail list logo