From b95e8e35c38286713adfc09ce067dd35764e965e Mon Sep 17 00:00:00 2001 From: James Harris <52711649+jamesharris-garmin@users.noreply.github.com> Date: Fri, 23 Aug 2019 10:48:40 -0500 Subject: [PATCH] Fix pytest --generate --fixtures flag This patch resolves the issues where pytest will try to double load the pytest_cmd_main. --- pytest_bdd/plugin.py | 2 +- tests/generation/test_generate_missing.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pytest_bdd/plugin.py b/pytest_bdd/plugin.py index f31e1af..437830b 100644 --- a/pytest_bdd/plugin.py +++ b/pytest_bdd/plugin.py @@ -81,7 +81,7 @@ def pytest_bdd_after_step(request, feature, scenario, step, step_func, step_func def pytest_cmdline_main(config): - generation.cmdline_main(config) + return generation.cmdline_main(config) def pytest_bdd_apply_tag(tag, function): diff --git a/tests/generation/test_generate_missing.py b/tests/generation/test_generate_missing.py index e8cd603..8e195ff 100644 --- a/tests/generation/test_generate_missing.py +++ b/tests/generation/test_generate_missing.py @@ -56,3 +56,6 @@ def test_generate_missing(testdir): ) result.stdout.fnmatch_lines(["Please place the code above to the test file(s):"]) + + assert not result.stderr.str() + assert result.ret == 0