Files
pytest2/testing/plugins_integration/bdd_wallet.py
Bruno Oliveira 878af85aef mypy: disallow untyped defs by default (#11862)
Change our mypy configuration to disallow untyped defs by default, which ensures *new* files added to the code base are fully typed.

To avoid having to type-annotate everything now, add `# mypy: allow-untyped-defs` to files which are not fully type annotated yet.

As we fully type annotate those modules, we can then just remove that directive from the top.
2024-01-28 10:12:42 -03:00

41 lines
645 B
Python

# mypy: allow-untyped-defs
from pytest_bdd import given
from pytest_bdd import scenario
from pytest_bdd import then
from pytest_bdd import when
import pytest
@scenario("bdd_wallet.feature", "Buy fruits")
def test_publish():
pass
@pytest.fixture
def wallet():
class Wallet:
amount = 0
return Wallet()
@given("A wallet with 50")
def fill_wallet(wallet):
wallet.amount = 50
@when("I buy some apples for 1")
def buy_apples(wallet):
wallet.amount -= 1
@when("I buy some bananas for 2")
def buy_bananas(wallet):
wallet.amount -= 2
@then("I have 47 left")
def check(wallet):
assert wallet.amount == 47