File: note_steps.py

package info (click to toggle)
behave 1.2.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,160 kB
  • sloc: python: 19,857; makefile: 137; sh: 18
file content (29 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- coding: utf-8 -*-
"""
Step definitions for providing notes/hints.
The note steps explain what was important in the last few steps of
this scenario (for a test reader).
"""

from __future__ import absolute_import
from behave import step


# -----------------------------------------------------------------------------
# STEPS FOR: remarks/comments
# -----------------------------------------------------------------------------
@step(u'note that "{remark}"')
def step_note_that(context, remark):
    """
    Used as generic step that provides an additional remark/hint
    and enhance the readability/understanding without performing any check.

    .. code-block:: gherkin

        Given that today is "April 1st"
          But note that "April 1st is Fools day (and beware)"
    """
    log = getattr(context, "log", None)
    if log:
        log.info(u"NOTE: %s;" % remark)