Skip to content

Commit b95e8e3

Browse files
jamesharris-garminyoutux
authored andcommitted
Fix pytest --generate --fixtures flag
This patch resolves the issues where pytest will try to double load the pytest_cmd_main.
1 parent 386ed90 commit b95e8e3

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pytest_bdd/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def pytest_bdd_after_step(request, feature, scenario, step, step_func, step_func
8181

8282

8383
def pytest_cmdline_main(config):
84-
generation.cmdline_main(config)
84+
return generation.cmdline_main(config)
8585

8686

8787
def pytest_bdd_apply_tag(tag, function):

tests/generation/test_generate_missing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,6 @@ def test_missing_steps():
5656
)
5757

5858
result.stdout.fnmatch_lines(["Please place the code above to the test file(s):"])
59+
60+
assert not result.stderr.str()
61+
assert result.ret == 0

0 commit comments

Comments
 (0)