|
| 1 | +import os |
1 | 2 | import re
|
2 | 3 |
|
3 |
| - |
4 | 4 | import pytest
|
5 | 5 |
|
6 |
| -from pytest_bdd import scenario, given, when, then |
| 6 | +from pytest_bdd import given, scenario, then, when |
7 | 7 | from tests.utils import get_test_filepath, prepare_feature_and_py_files
|
8 | 8 |
|
9 | 9 |
|
@@ -349,18 +349,18 @@ def output_output_must_contain_parameters_values(test_execution, gherkin_scenari
|
349 | 349 |
|
350 | 350 | @pytest.mark.parametrize(
|
351 | 351 | 'feature_file, py_file, name', [
|
352 |
| - ('./steps/unicode.feature', './steps/test_unicode.py', 'test_steps_in_feature_file_have_unicode') |
| 352 | + ('./steps/unicode.feature', './steps/test_unicode.py', 'test_steps_in_feature_file_have_unicode'), |
| 353 | + ('./feature/parametrized.feature', './feature/test_parametrized.py', 'test_parametrized') |
353 | 354 | ]
|
354 | 355 | )
|
355 |
| -def test_scenario_in_expanded_mode(testdir, test_execution, feature_file, py_file, name): |
| 356 | +def test_scenario_in_expanded_mode(testdir, feature_file, py_file, name): |
356 | 357 | prepare_feature_and_py_files(testdir, feature_file, py_file)
|
357 | 358 |
|
358 |
| - test_execution['gherkin'] = testdir.runpytest( |
359 |
| - '-k %s' % name, |
| 359 | + py_filename = os.path.basename(py_file) |
| 360 | + result = testdir.runpytest( |
| 361 | + '%s::%s' % (py_filename, name), |
360 | 362 | '--gherkin-terminal-reporter',
|
361 | 363 | '--gherkin-terminal-reporter-expanded',
|
362 | 364 | '-vv',
|
363 | 365 | )
|
364 |
| - |
365 |
| - ghe = test_execution['gherkin'] |
366 |
| - ghe.assert_outcomes(passed=1) |
| 366 | + result.assert_outcomes(passed=1) |
0 commit comments