def test_withdraw_insufficient_amount(): account = Account() # When a function raises some Exception, use this way with pytest.raises(InsufficientBalance): account.withdraw_cash(5)
def test_transactions(initial, added, withdrawn, remaining): account = Account(initial) account.add_cash(added) account.withdraw_cash(withdrawn) assert account.balance == remaining
def test_account_withdraw_cash(): account = Account(10) account.withdraw_cash(5) assert account.balance == 5