| 1 |
#!/usr/bin/env python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
from __future__ import absolute_import |
| 5 |
# -- ENSURE: Use local path during development. |
| 6 |
import sys |
| 7 |
import os.path |
| 8 |
|
| 9 |
# ---------------------------------------------------------------------------- |
| 10 |
# SETUP PATHS: |
| 11 |
# ---------------------------------------------------------------------------- |
| 12 |
NAME = "behave" |
| 13 |
HERE = os.path.dirname(__file__) |
| 14 |
TOP = os.path.join(HERE, "..") |
| 15 |
if os.path.isdir(os.path.join(TOP, NAME)): |
| 16 |
sys.path.insert(0, os.path.abspath(TOP)) |
| 17 |
|
| 18 |
# ---------------------------------------------------------------------------- |
| 19 |
# BEHAVE-TWEAKS: |
| 20 |
# ---------------------------------------------------------------------------- |
| 21 |
def setup_behave(): |
| 22 |
""" |
| 23 |
Apply tweaks, extensions and patches to "behave". |
| 24 |
""" |
| 25 |
from behave.configuration import Configuration |
| 26 |
# -- DISABLE: Timings to simplify issue.features/ tests. |
| 27 |
# Configuration.defaults["format0"] = "pretty" |
| 28 |
# Configuration.defaults["format0"] = "progress" |
| 29 |
Configuration.defaults["show_timings"] = False |
| 30 |
|
| 31 |
def behave_main0(): |
| 32 |
# from behave.configuration import Configuration |
| 33 |
from behave.__main__ import main as behave_main |
| 34 |
setup_behave() |
| 35 |
return behave_main() |
| 36 |
|
| 37 |
# ---------------------------------------------------------------------------- |
| 38 |
# MAIN: |
| 39 |
# ---------------------------------------------------------------------------- |
| 40 |
if __name__ == "__main__": |
| 41 |
if "COVERAGE_PROCESS_START" in os.environ: |
| 42 |
import coverage |
| 43 |
coverage.process_startup() |
| 44 |
sys.exit(behave_main0()) |