~landscape/zope3/ztk-1.1.3

« back to all changes in this revision

Viewing changes to src/zope/testing/testrunner/feature.py

  • Committer: Thomas Hervé
  • Date: 2009-09-21 06:45:37 UTC
  • mfrom: (7.1.2 newer-zope-testing)
  • Revision ID: thomas@canonical.com-20090921064537-zcfyuv32hxj9eah0
Merge newer-zope-testing [a=sidnei] [f=429702] [r=therve,free.ekayanaka]

Update zope.testing to 3.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
##############################################################################
 
2
#
 
3
# Copyright (c) 2004-2008 Zope Corporation and Contributors.
 
4
# All Rights Reserved.
 
5
#
 
6
# This software is subject to the provisions of the Zope Public License,
 
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 
11
# FOR A PARTICULAR PURPOSE.
 
12
#
 
13
##############################################################################
 
14
"""Generic features for the test runner.
 
15
 
 
16
$Id: __init__.py 86232 2008-05-03 15:09:33Z ctheune $
 
17
"""
 
18
 
 
19
import zope.interface
 
20
import zope.testing.testrunner.interfaces
 
21
 
 
22
 
 
23
class Feature(object):
 
24
    """A base class implementing no-op methods for the IFeature interface."""
 
25
 
 
26
    zope.interface.implements(zope.testing.testrunner.interfaces.IFeature)
 
27
 
 
28
    active = False
 
29
 
 
30
    def __init__(self, runner):
 
31
        self.runner = runner
 
32
 
 
33
    def global_setup(self):
 
34
        """Executed once when the test runner is being set up."""
 
35
        pass
 
36
 
 
37
    def late_setup(self):
 
38
        """Executed once right before the actual tests get executed and after
 
39
        all global setups have happened.
 
40
        """
 
41
        pass
 
42
 
 
43
    def layer_setup(self, layer):
 
44
        """Executed once after a layer was set up."""
 
45
        pass
 
46
 
 
47
    def layer_teardown(self, layer):
 
48
        """Executed once after a layer was run."""
 
49
        pass
 
50
 
 
51
    def test_setup(self):
 
52
        """Executed once before each test."""
 
53
        pass
 
54
 
 
55
    def test_teardown(self):
 
56
        """Executed once after each test."""
 
57
        pass
 
58
 
 
59
    def early_teardown(self):
 
60
        """Executed once directly after all tests."""
 
61
        pass
 
62
 
 
63
    def global_teardown(self):
 
64
        """Executed once after all tests where run and early teardowns have
 
65
        happened."""
 
66
        pass
 
67
 
 
68
    def report(self):
 
69
        """Executed once after all tests have been run and all setup was
 
70
        torn down."""
 
71
        pass