Exemplo n.º 1
0
 def __init__(self):
     before.each_feature(self.time_recorder_before_each_feature)
     before.each_scenario(self.time_recorder_before_each_scenario)
     before.each_step(self.time_recorder_before_each_step)
     after.each_feature(self.time_recorder_after_each_feature)
     after.each_scenario(self.time_recorder_after_each_scenario)
     after.each_step(self.time_recorder_after_each_step)
Exemplo n.º 2
0
 def __init__(self):
     before.each_feature(self.time_recorder_before_each_feature)
     before.each_scenario(self.time_recorder_before_each_scenario)
     before.each_step(self.time_recorder_before_each_step)
     after.each_feature(self.time_recorder_after_each_feature)
     after.each_scenario(self.time_recorder_after_each_scenario)
     after.each_step(self.time_recorder_after_each_step)
Exemplo n.º 3
0
 def __init__(self):
     before.all(self.syslog_writer_before_all)
     before.each_feature(self.syslog_writer_before_each_feature)
     before.each_scenario(self.syslog_writer_before_each_scenario)
     before.each_step(self.syslog_writer_before_each_step)
     after.all(self.syslog_writer_after_all)
     after.each_feature(self.syslog_writer_after_each_feature)
     after.each_scenario(self.syslog_writer_after_each_scenario)
     after.each_step(self.syslog_writer_after_each_step)
Exemplo n.º 4
0
    def __init__(self):
        before.each_feature(self.console_writer_before_each_feature)
        before.each_scenario(self.console_writer_before_each_scenario)
        before.each_step(self.console_writer_before_each_step)
        after.each_feature(self.console_writer_after_each_feature)
        after.each_scenario(self.console_writer_after_each_scenario)
        after.each_step(self.console_writer_after_each_step)

        self.last_precondition = None
Exemplo n.º 5
0
 def __init__(self):
     before.all(self.syslog_writer_before_all)
     before.each_feature(self.syslog_writer_before_each_feature)
     before.each_scenario(self.syslog_writer_before_each_scenario)
     before.each_step(self.syslog_writer_before_each_step)
     after.all(self.syslog_writer_after_all)
     after.each_feature(self.syslog_writer_after_each_feature)
     after.each_scenario(self.syslog_writer_after_each_scenario)
     after.each_step(self.syslog_writer_after_each_step)
Exemplo n.º 6
0
    def __init__(self):
        before.each_feature(self.console_writer_before_each_feature)
        before.each_scenario(self.console_writer_before_each_scenario)
        before.each_step(self.console_writer_before_each_step)
        after.each_feature(self.console_writer_after_each_feature)
        after.each_scenario(self.console_writer_after_each_scenario)
        after.each_step(self.console_writer_after_each_step)

        self.last_precondition = None
Exemplo n.º 7
0
    def __init__(self):
        before.each_feature(self.console_writer_before_each_feature)
        before.each_scenario(self.console_writer_before_each_scenario)
        before.each_step(self.console_writer_before_each_step)
        after.each_feature(self.console_writer_after_each_feature)
        after.each_scenario(self.console_writer_after_each_scenario)
        after.each_step(self.console_writer_after_each_step)

        self.last_precondition = None
        self.last_background = None

        self._placeholder_regex = re.compile(r"(<[\w-]+>)", flags=re.UNICODE)
Exemplo n.º 8
0
    def __init__(self):
        before.each_feature(self.console_writer_before_each_feature)
        before.each_scenario(self.console_writer_before_each_scenario)
        before.each_step(self.console_writer_before_each_step)
        after.each_feature(self.console_writer_after_each_feature)
        after.each_scenario(self.console_writer_after_each_scenario)
        after.each_step(self.console_writer_after_each_step)

        self.last_precondition = None
        self.last_background = None

        self._placeholder_regex = re.compile(r'(<[\w-]+>)', flags=re.UNICODE)
Exemplo n.º 9
0
    def __init__(self):
        # import syslog only if the extension got loaded
        # but not if the module got loaded.
        import syslog

        before.all(self.syslog_writer_before_all)
        before.each_feature(self.syslog_writer_before_each_feature)
        before.each_scenario(self.syslog_writer_before_each_scenario)
        before.each_step(self.syslog_writer_before_each_step)
        after.all(self.syslog_writer_after_all)
        after.each_feature(self.syslog_writer_after_each_feature)
        after.each_scenario(self.syslog_writer_after_each_scenario)
        after.each_step(self.syslog_writer_after_each_step)
Exemplo n.º 10
0
    def __init__(self):
        before.each_feature(is_formatter=True)(write_feature_header)
        after.each_feature(is_formatter=True)(write_feature_footer)

        before.each_rule(is_formatter=True)(write_rule_header)

        before.each_scenario(is_formatter=True)(write_scenario_header)
        after.each_scenario(is_formatter=True)(write_scenario_footer)

        before.each_step(is_formatter=True)(write_step_running)
        after.each_step(is_formatter=True)(write_step_result)

        after.all(is_formatter=True)(write_summary)
Exemplo n.º 11
0
    def __init__(self, marker):
        self.marker = marker
        # import syslog only if the extension got loaded
        # but not if the module got loaded.
        import syslog  # noqa

        before.all()(self.syslog_writer_before_all)
        before.each_feature()(self.syslog_writer_before_each_feature)
        before.each_scenario()(self.syslog_writer_before_each_scenario)
        before.each_step()(self.syslog_writer_before_each_step)
        after.all()(self.syslog_writer_after_all)
        after.each_feature()(self.syslog_writer_after_each_feature)
        after.each_scenario()(self.syslog_writer_after_each_scenario)
        after.each_step()(self.syslog_writer_after_each_step)
Exemplo n.º 12
0
"""
radish
~~~~~~

The root from red to green. BDD tooling for Python.

:copyright: (c) 2019 by Timo Furrer <*****@*****.**>
:license: MIT, see LICENSE for more details.
"""

from radish.models.timed import Timed
from radish.hookregistry import before, after


def record_starttime(timed_model: Timed):
    """Record the start time for the given Model"""
    timed_model.record_starttime()


def record_endtime(timed_model: Timed):
    """Record the end time for the given Model"""
    timed_model.record_endtime()


before.each_feature(always=True)(lambda f: record_starttime(f))
before.each_scenario(always=True)(lambda f: record_starttime(f))
before.each_step(always=True)(lambda f: record_starttime(f))
after.each_feature(always=True)(lambda f: record_endtime(f))
after.each_scenario(always=True)(lambda f: record_endtime(f))
after.each_step(always=True)(lambda f: record_endtime(f))