mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-13645 BDD: Scenario name is cut out from step name
This commit is contained in:
@@ -27,7 +27,7 @@ def get_path_by_args(arguments):
|
||||
assert os.path.exists(what_to_run), "{} does not exist".format(what_to_run)
|
||||
|
||||
if os.path.isfile(what_to_run):
|
||||
base_dir = os.path.dirname(what_to_run) # User may point to the file directly
|
||||
base_dir = os.path.dirname(what_to_run) # User may point to the file directly
|
||||
return base_dir, what_to_run
|
||||
|
||||
|
||||
@@ -178,9 +178,9 @@ class BddRunner(object):
|
||||
num_of_steps = 0
|
||||
for feature in self._get_features_to_run():
|
||||
if feature.background:
|
||||
num_of_steps += len(feature.background.steps) * len(feature.scenarios)
|
||||
num_of_steps += len(list(feature.background.steps)) * len(list(feature.scenarios))
|
||||
for scenario in feature.scenarios:
|
||||
num_of_steps += len(scenario.steps)
|
||||
num_of_steps += len(list(scenario.steps))
|
||||
return num_of_steps
|
||||
|
||||
@abc.abstractmethod
|
||||
|
||||
@@ -136,10 +136,11 @@ class _BehaveRunner(_bdd_utils.BddRunner):
|
||||
element.location.file = element.location.filename # To preserve _bdd_utils contract
|
||||
if isinstance(element, Step):
|
||||
# Process step
|
||||
step_name = "{} {}".format(element.keyword, element.name)
|
||||
if is_started:
|
||||
self._test_started(element.name, element.location)
|
||||
self._test_started(step_name, element.location)
|
||||
elif element.status == 'passed':
|
||||
self._test_passed(element.name, element.duration)
|
||||
self._test_passed(step_name, element.duration)
|
||||
elif element.status == 'failed':
|
||||
try:
|
||||
trace = traceback.format_exc()
|
||||
@@ -147,11 +148,11 @@ class _BehaveRunner(_bdd_utils.BddRunner):
|
||||
trace = "".join(traceback.format_tb(element.exc_traceback))
|
||||
if trace in str(element.error_message):
|
||||
trace = None # No reason to duplicate output (see PY-13647)
|
||||
self._test_failed(element.name, element.error_message, trace)
|
||||
self._test_failed(step_name, element.error_message, trace)
|
||||
elif element.status == 'undefined':
|
||||
self._test_undefined(element.name, element.location)
|
||||
self._test_undefined(step_name, element.location)
|
||||
else:
|
||||
self._test_skipped(element.name, element.status, element.location)
|
||||
self._test_skipped(step_name, element.status, element.location)
|
||||
elif not is_started and isinstance(element, Scenario) and element.status == 'failed':
|
||||
# To process scenarios with undefined/skipped tests
|
||||
for step in element.steps:
|
||||
|
||||
Reference in New Issue
Block a user