~ztk-steering-group/zope.testrunner/trunk

« back to all changes in this revision

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

  • Committer: mgedmin
  • Date: 2013-02-11 20:02:43 UTC
  • Revision ID: svn-v4:62d5b8a3-27da-0310-9561-8e5933582275:zope.testrunner/trunk:129304
Moved to github

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
##############################################################################
2
 
#
3
 
# Copyright (c) 2004-2008 Zope Foundation 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
 
 
17
 
import zope.interface
18
 
import zope.testrunner.interfaces
19
 
 
20
 
 
21
 
@zope.interface.implementer(zope.testrunner.interfaces.IFeature)
22
 
class Feature(object):
23
 
    """A base class implementing no-op methods for the IFeature interface."""
24
 
 
25
 
 
26
 
    active = False
27
 
 
28
 
    def __init__(self, runner):
29
 
        self.runner = runner
30
 
 
31
 
    def global_setup(self):
32
 
        """Executed once when the test runner is being set up."""
33
 
        pass
34
 
 
35
 
    def late_setup(self):
36
 
        """Executed once right before the actual tests get executed and after
37
 
        all global setups have happened.
38
 
        """
39
 
        pass
40
 
 
41
 
    def layer_setup(self, layer):
42
 
        """Executed once after a layer was set up."""
43
 
        pass
44
 
 
45
 
    def layer_teardown(self, layer):
46
 
        """Executed once after a layer was run."""
47
 
        pass
48
 
 
49
 
    def test_setup(self):
50
 
        """Executed once before each test."""
51
 
        pass
52
 
 
53
 
    def test_teardown(self):
54
 
        """Executed once after each test."""
55
 
        pass
56
 
 
57
 
    def early_teardown(self):
58
 
        """Executed once directly after all tests."""
59
 
        pass
60
 
 
61
 
    def global_teardown(self):
62
 
        """Executed once after all tests where run and early teardowns have
63
 
        happened."""
64
 
        pass
65
 
 
66
 
    def report(self):
67
 
        """Executed once after all tests have been run and all setup was
68
 
        torn down."""
69
 
        pass