From 349b47dec56880d83fa8433dc63344b5870e6e00 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:14:50 +0000 Subject: [PATCH 1/3] Initial plan From 6df2afbe565a97f0878bdf2671d5b83aafcb3dd6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:14:46 +0000 Subject: [PATCH 2/3] Add test for no usefixtures() warning when scenario has no fixture args Agent-Logs-Url: https://github.com/pytest-dev/pytest-bdd/sessions/6e63f920-f1b8-408c-952d-4b688cc32427 Co-authored-by: youtux <778703+youtux@users.noreply.github.com> --- tests/feature/test_scenario.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/feature/test_scenario.py b/tests/feature/test_scenario.py index bd092f510..6a0a8a1d9 100644 --- a/tests/feature/test_scenario.py +++ b/tests/feature/test_scenario.py @@ -397,6 +397,35 @@ def _(): ] +def test_no_usefixtures_warning_when_no_args(pytester): + """Test that no PytestWarning about usefixtures() without arguments is emitted + when scenario functions have no arguments (e.g. when using scenarios()). + + Regression test for https://github.com/pytest-dev/pytest-bdd/issues/XXX + """ + pytester.makefile( + ".feature", + simple=""" + Feature: Simple feature + Scenario: Simple scenario with no args + Given I have a bar + """, + ) + pytester.makepyfile( + """ + from pytest_bdd import scenarios, given + + scenarios("simple.feature") + + @given("I have a bar") + def _(): + return "bar" + """ + ) + result = pytester.runpytest("-W", "error::pytest.PytestWarning") + result.assert_outcomes(passed=1) + + def test_default_value_is_used_as_fallback(pytester): """Test that the default value for a step implementation is only used as a fallback.""" pytester.makefile( From 709659ab89e476bdce522733cbf1ddddb5497795 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Apr 2026 23:15:43 +0000 Subject: [PATCH 3/3] Fix issue reference URL in test docstring (replace XXX with issue number 802) Agent-Logs-Url: https://github.com/pytest-dev/pytest-bdd/sessions/6e63f920-f1b8-408c-952d-4b688cc32427 Co-authored-by: youtux <778703+youtux@users.noreply.github.com> --- tests/feature/test_scenario.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/feature/test_scenario.py b/tests/feature/test_scenario.py index 6a0a8a1d9..f671971b5 100644 --- a/tests/feature/test_scenario.py +++ b/tests/feature/test_scenario.py @@ -401,7 +401,7 @@ def test_no_usefixtures_warning_when_no_args(pytester): """Test that no PytestWarning about usefixtures() without arguments is emitted when scenario functions have no arguments (e.g. when using scenarios()). - Regression test for https://github.com/pytest-dev/pytest-bdd/issues/XXX + Regression test for https://github.com/pytest-dev/pytest-bdd/issues/802 """ pytester.makefile( ".feature",