"""
Unit testing decorators.
"""

__version__ = "$Revision: 11181 $"

__all__ = ["test", "before", "after"]


def test(method):
    """Decorator that flags a method as a test method."""
    method._unittest = True
    return method


def before(method):
    """Decorator that flags a method as fixture setup.
    
    Fixture setup methods from base classes are guaranteed to be executed
    before setup methods from derived classes.
    
    """
    method._unittest_before = True
    return method


def after(method):
    """Decorator that flags a method as fixture teardown.
    
    Fixture teardown methods from base classes are guaranteed to be executed
    after teardown methods from derived classes.
    
    """
    method._unittest_after = True
    return method
