Skip to content

Commit 3a7a5c4

Browse files
Merge pull request #289 from pytest-dev/generated-steps-raise-notimplemented
Generated steps should raise NotImplementedError
2 parents 2b60fbc + 61bf486 commit 3a7a5c4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Unreleased
55
----------
66

77
- Drop support for pytest < 3.3.2
8+
- Step definitions generated by `pytest-bdd generate` will now `raise NotImplementedError` by default.
89

910
3.0.2
1011
------

pytest_bdd/templates/test.py.mak

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_${ make_python_name(scenario.name)}():
2222
@${step.type}('${step.name}')
2323
def ${ make_python_name(step.name)}():
2424
"""${step.name}."""
25+
raise NotImplementedError
2526
% if not loop.last:
2627

2728

tests/scripts/test_generate.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,24 @@ def test_given_and_when_using_the_same_fixture_should_not_evaluate_it_twice():
3333
@given('1 have a fixture (appends 1 to a list) in reuse syntax')
3434
def have_a_fixture_appends_1_to_a_list_in_reuse_syntax():
3535
"""1 have a fixture (appends 1 to a list) in reuse syntax."""
36+
raise NotImplementedError
3637
3738
3839
@given('I have an empty list')
3940
def i_have_an_empty_list():
4041
"""I have an empty list."""
42+
raise NotImplementedError
4143
4244
4345
@when('I use this fixture')
4446
def i_use_this_fixture():
4547
"""I use this fixture."""
48+
raise NotImplementedError
4649
4750
4851
@then('my list should be [1]')
4952
def my_list_should_be_1():
5053
"""my list should be [1]."""
54+
raise NotImplementedError
5155
5256
'''[1:].replace(u"'", u"'"))

0 commit comments

Comments
 (0)