def account_with_random_balance(): account = BankAccount() account.credit(random.randint(100, 200)) return account