Part of canonical.testing.layers View In Hierarchy
Known subclasses: canonical.testing.layers.DatabaseLayer, canonical.testing.layers.FunctionalLayer, canonical.testing.layers.GoogleServiceLayer, canonical.testing.layers.LibrarianLayer, canonical.testing.layers.MemcachedLayer, canonical.testing.layers.TwistedLayer, canonical.testing.layers.ZopelessLayer
All out layers should subclass Base, as this is where we will put test isolation checks to ensure that tests to not leave global resources in a mess.
XXX: StuartBishop 2006-07-12: Unit tests (tests with no layer) will not get these checks. The Z3 test runner should be updated so that a layer can be specified to use for unit tests.
| Class Method | setUp | Undocumented |
| Class Method | tearDown | Undocumented |
| Class Method | testSetUp | Undocumented |
| Class Method | testTearDown | Undocumented |
| Class Method | check | Check that the environment is working as expected. |
| Class Method | flagTestIsolationFailure | Handle a breakdown in test isolation. |
| Class Method | getCurrentTestResult | Return the TestResult currently in play. |
| Class Method | getCurrentTestCase | Return the test currently in play. |
We check here so we can detect tests that, for example, initialize the Zopeless or Functional environments and are using the incorrect layer.
If the test that broke isolation thinks it succeeded, add an error. If the test failed, don't add a notification as the isolation breakdown is probably just fallout.
The layer that detected the isolation failure still needs to repair the damage, or in the worst case abort the test run.