Part of lp.testing.layers View In Hierarchy
Known subclasses: lp.codehosting.codeimport.tests.test_worker.ForeignBranchPluginLayer, lp.testing.layers.BingServiceLayer, lp.testing.layers.DatabaseLayer, lp.testing.layers.FunctionalLayer, lp.testing.layers.MemcachedLayer, lp.testing.layers.RabbitMQLayer, lp.testing.layers.TwistedLayer, lp.testing.layers.ZopelessLayer
All our 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 | make_config | Create a temporary config and link it into the layer cleanup. |
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. |
Class Method | appserver_config | Return a config suitable for AppServer tests. |
Class Method | appserver_root_url | Return the correct app server root url for the given facet. |
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.