Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -1287,6 +1287,7 @@ You can use pytest-factoryboy to automatically create model fixtures for this cl
class Meta:
model = Wallet

verified = False
amount_eur = 0
amount_usd = 0
amount_gbp = 0
Expand All @@ -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):
Expand Down Expand Up @@ -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
Expand Down
Loading