Skip to content

Commit b3370c3

Browse files
sliwinski-miloszyoutux
authored andcommitted
gherkin terminal reporter tests steps renamed to not being collected as test items by pytest
1 parent a8795da commit b3370c3

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

tests/feature/gherkin_terminal_reporter.feature

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@ Feature: Gherkin terminal reporter
22

33
Scenario: Should default output be the same as regular terminal reporter
44
Given there is gherkin scenario implemented
5-
When tests are run
5+
When I run tests
66
Then output must be formatted the same way as regular one
77

88
Scenario: Should verbose mode enable displaying feature and scenario names rather than test names in a single line
99
Given there is gherkin scenario implemented
10-
When tests are run with verbose mode
10+
When I run tests with verbose mode
1111
Then output should contain single line feature description
1212
And output should contain single line scenario description
1313

1414
Scenario: Should verbose mode preserve displaying of regular tests as usual
1515
Given there is non-gherkin scenario implemented
16-
When tests are run with verbose mode
16+
When I run tests with verbose mode
1717
Then output must be formatted the same way as regular one
1818

1919
Scenario: Should double verbose mode enable displaying of full gherkin scenario description
2020
Given there is gherkin scenario implemented
21-
When tests are run with very verbose mode
21+
When I run tests with very verbose mode
2222
Then output must contain full gherkin scenario description
2323

2424
Scenario: Should error message be displayed when no scenario is found
2525
Given there is gherkin scenario without implementation
26-
When tests are run with any verbosity mode
26+
When I run tests with any verbosity mode
2727
Then output contains error about missing scenario implementation
2828

2929
Scenario: Should error message be displayed when no step is found
3030
Given there is gherkin scenario partially implemented
31-
When tests are run with any verbosity mode
31+
When I run tests with any verbosity mode
3232
Then output contains error about missing step implementation
3333

3434
Scenario: Should error message be displayed when error occurs during test execution
3535
Given there is gherkin scenario with broken implementation
36-
When tests are run with any verbosity mode
36+
When I run tests with any verbosity mode
3737
Then output contains error about missing scenario implementation
3838

3939
Scenario: Should local variables be displayed when --showlocals option is used
4040
Given there is gherkin scenario with broken implementation
41-
When tests are run with --showlocals
41+
When I run tests with --showlocals
4242
Then error traceback contains local variable descriptions
4343

4444
Scenario: Should step parameters be replaced by their values
4545
Given there is gherkin scenario outline implemented
46-
When tests are run with step expanded mode
46+
When I run tests with step expanded mode
4747
Then output must contain parameters values

tests/feature/test_gherkin_terminal_reporter.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def test_scenario_2():
152152
return example
153153

154154

155-
@when("tests are run")
156-
def tests_are_run(testdir, test_execution):
155+
@when("I run tests")
156+
def run_tests(testdir, test_execution):
157157
test_execution['regular'] = testdir.runpytest()
158158
test_execution['gherkin'] = testdir.runpytest('--gherkin-terminal-reporter')
159159

@@ -173,20 +173,20 @@ def output_must_be_the_same_as_regular_reporter(test_execution):
173173
assert l1 == l2
174174

175175

176-
@when("tests are run with verbose mode")
177-
def tests_are_run_with_verbose_mode(testdir, test_execution):
176+
@when("I run tests with verbose mode")
177+
def run_tests_with_verbose_mode(testdir, test_execution):
178178
test_execution['regular'] = testdir.runpytest('-v')
179179
test_execution['gherkin'] = testdir.runpytest('--gherkin-terminal-reporter', '-v')
180180

181181

182-
@when("tests are run with very verbose mode")
183-
def tests_are_run_with_very_verbose_mode(testdir, test_execution):
182+
@when("I run tests with very verbose mode")
183+
def run_tests_with_very_verbose_mode(testdir, test_execution):
184184
test_execution['regular'] = testdir.runpytest('-vv')
185185
test_execution['gherkin'] = testdir.runpytest('--gherkin-terminal-reporter', '-vv')
186186

187187

188-
@when("tests are run with step expanded mode")
189-
def tests_are_run_with_step_expanded_mode(testdir, test_execution):
188+
@when("I run tests with step expanded mode")
189+
def run_tests_with_step_expanded_mode(testdir, test_execution):
190190
test_execution['regular'] = testdir.runpytest('-vv')
191191
test_execution['gherkin'] = testdir.runpytest(
192192
'--gherkin-terminal-reporter',
@@ -238,8 +238,8 @@ def gherkin_scenario_without_implementation(testdir):
238238
""")
239239

240240

241-
@when('tests are run with any verbosity mode')
242-
def tests_are_run_with_any_verbosity_mode(
241+
@when('I run tests with any verbosity mode')
242+
def run_tests_with_any_verbosity_mode(
243243
test_execution, verbosity_mode, testdir,
244244
gherkin_scenario_without_implementation):
245245
# test_execution['gherkin'] = testdir.runpytest(
@@ -323,8 +323,8 @@ def test_scenario_1():
323323
""")
324324

325325

326-
@when('tests are run with --showlocals')
327-
def tests_are_run_with___showlocals(test_execution, testdir):
326+
@when('I run tests with --showlocals')
327+
def run_tests_with___showlocals(test_execution, testdir):
328328
test_execution['gherkin'] = testdir.runpytest('--gherkin-terminal-reporter', '--showlocals')
329329

330330

0 commit comments

Comments
 (0)