File: behave_cmd.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 (44 lines) | stat: -rwxr-xr-x 1,535 bytes parent folder | download | duplicates (8)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import absolute_import
# -- ENSURE: Use local path during development.
import sys
import os.path

# ----------------------------------------------------------------------------
# SETUP PATHS:
# ----------------------------------------------------------------------------
NAME = "behave"
HERE = os.path.dirname(__file__)
TOP  = os.path.join(HERE, "..")
if os.path.isdir(os.path.join(TOP, NAME)):
    sys.path.insert(0, os.path.abspath(TOP))

# ----------------------------------------------------------------------------
# BEHAVE-TWEAKS:
# ----------------------------------------------------------------------------
def setup_behave():
    """
    Apply tweaks, extensions and patches to "behave".
    """
    from behave.configuration import Configuration
    # -- DISABLE: Timings to simplify issue.features/ tests.
    # Configuration.defaults["format0"] = "pretty"
    # Configuration.defaults["format0"] = "progress"
    Configuration.defaults["show_timings"] = False

def behave_main0():
    # from behave.configuration import Configuration
    from behave.__main__ import main as behave_main
    setup_behave()
    return behave_main()

# ----------------------------------------------------------------------------
# MAIN:
# ----------------------------------------------------------------------------
if __name__ == "__main__":
    if "COVERAGE_PROCESS_START" in os.environ:
        import coverage
        coverage.process_startup()
    sys.exit(behave_main0())