[Grok-dev] z3c.testseup: populating globs and test layers

Jan-Wijbrand Kolman janwijbrand at gmail.com
Tue Oct 20 10:21:44 EDT 2009


 From the z3c.testsetup pypi page:


A dictionary of things that should be available immediately (without 
imports) during tests. Default is an empty dict, which might be 
populated by appropriate layers (see below). ZCML layers for example get 
you the getRootFolder method automatically.

This parameter is a fallback which can be overriden by testfile markers 
specifying a certain layer (see below).

The globs parameter applies only to doctests, not to plain python unittests.

This is exactly what I need; populating a test's globals from a layer.

Except, it doesn't work.

Or, at least, I do not see how.

There's no documentation on how to do this and if I look at 
z3c.testsetup and zope.app.testing code, I do not see how you can get to 
the actual test's globals at all - layers have no reference to the test.

Am I doing something wrong here?


More information about the Grok-dev mailing list