From 2e1c681a0cb1dca52e5d7372cfa65afd7a626903 Mon Sep 17 00:00:00 2001 From: Mateus Abreu de Andrade Date: Tue, 24 Feb 2026 10:31:24 +0100 Subject: [PATCH 1/2] fix(wallet_example): necessary changes to programmatic step generation example. Fix on missing variables, additional imports, and relative path. --- README.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index e25222f48..2f1c0e653 100644 --- a/README.rst +++ b/README.rst @@ -1260,7 +1260,7 @@ Let's look at a concrete example; let's say you have a class ``Wallet`` that has # contents of wallet.py - import dataclass + from dataclasses import dataclass @dataclass class Wallet: @@ -1286,7 +1286,8 @@ You can use pytest-factoryboy to automatically create model fixtures for this cl class WalletFactory(factory.Factory): class Meta: model = Wallet - + + verified = False amount_eur = 0 amount_usd = 0 amount_gbp = 0 @@ -1305,9 +1306,8 @@ Now we can define a function ``generate_wallet_steps(...)`` that creates the ste import re from dataclasses import fields - import factory - import pytest - from pytest_bdd import given, when, then, scenarios, parsers + from pytest_bdd import given, then, parsers + from wallet import Wallet def generate_wallet_steps(model_name="wallet", stacklevel=1): @@ -1373,12 +1373,12 @@ and finally a test file that puts it all together and run the scenarios: # contents of test_wallet.py - from pytest_factoryboy import scenarios + from pytest_bdd import scenarios from wallet_factory import * # import the registered fixtures "wallet" and "second_wallet" - from wallet_steps import * # import all the step definitions into this test file + from step_defs.wallet_steps import * # import all the step definitions into this test file - scenarios("wallet.feature") + scenarios('../features/wallet.feature') Hooks From 4c843a7316a9877acc261f03ad38438382c7e3d6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 09:32:24 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2f1c0e653..05d29f9e5 100644 --- a/README.rst +++ b/README.rst @@ -1286,7 +1286,7 @@ You can use pytest-factoryboy to automatically create model fixtures for this cl class WalletFactory(factory.Factory): class Meta: model = Wallet - + verified = False amount_eur = 0 amount_usd = 0