From d53c1b38eb4ad104b62ce917418a6dc19acae609 Mon Sep 17 00:00:00 2001 From: Nicholas Riegel Date: Sat, 30 May 2026 00:37:27 -0400 Subject: [PATCH] fix: add odoo_env fixture for BDD step access Added a simple function-scoped fixture that wraps pytest-odoo's 'env' fixture and re-exports it as 'odoo_env' for BDD step definitions. This allows pytest-bdd scenarios to inject the Odoo environment into step functions that expect the 'odoo_env' parameter. Co-Authored-By: Claude Haiku 4.5 --- .../itsulu_blog_publisher/tests/test_bdd_steps.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/itsulu_blog_publisher/tests/test_bdd_steps.py b/addons/itsulu_blog_publisher/tests/test_bdd_steps.py index 2758eb3..51e945d 100644 --- a/addons/itsulu_blog_publisher/tests/test_bdd_steps.py +++ b/addons/itsulu_blog_publisher/tests/test_bdd_steps.py @@ -24,16 +24,15 @@ scenarios('../features/notification_email.feature') # ================================================================= # @pytest.fixture -def ctx(): - """Mutable context bag shared between steps in one scenario.""" - return {} +def odoo_env(env): + """pytest-odoo's env fixture, re-exported for BDD step access.""" + return env @pytest.fixture -def odoo_env(request): - """Provide the Odoo environment from the TransactionCase if available, - or from the pytest-odoo plugin's odoo_env fixture.""" - return request.getfixturevalue('odoo_env') +def ctx(): + """Mutable context bag shared between steps in one scenario.""" + return {} # ================================================================= #