Skip to content

Commit

Permalink
add step fail hook (#3384)
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisChu committed Dec 1, 2021
1 parent c198596 commit c499116
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import os
import pytest
import logging

from tests.common.configs import all_configs
from tests.common.types import SpaceDesc
Expand Down Expand Up @@ -64,6 +65,16 @@ def pytest_addoption(parser):
help="Nebula Graph workspace")


def pytest_bdd_step_error(request, feature, scenario, step, step_func, step_func_args):
logging.info("=== more error information ===")
logging.info("feature is {}".format(feature.filename))
logging.info("step line number is {}".format(step.line_number))
logging.info("step name is {}".format(step.name))
if step_func_args.get("graph_spaces") is not None:
graph_spaces = step_func_args.get("graph_spaces")
if graph_spaces.get("space_desc") is not None:
logging.info("error space is {}".format(graph_spaces.get("space_desc")))


def pytest_configure(config):
pytest.cmdline.address = config.getoption("address")
Expand Down

0 comments on commit c499116

Please sign in to comment.