-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an exception for
IndexError
inside `uninferable_final_decorator…
…s` method.
- Loading branch information
Showing
5 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/functional/r/regression/regression_6531_crash_index_error.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# pylint: disable=missing-docstring | ||
|
||
import pytest | ||
|
||
|
||
class Wallet: | ||
def __init__(self): | ||
self.balance = 0 | ||
|
||
def add_cash(self, earned): | ||
self.balance += earned | ||
|
||
def spend_cash(self, spent): | ||
self.balance -= spent | ||
|
||
@pytest.fixture(name="my_wallet") | ||
def fixture_my_wallet(): | ||
'''Returns a Wallet instance with a zero balance''' | ||
return Wallet() | ||
|
||
@pytest.mark.parametrize("earned,spent,expected", [ | ||
(30, 10, 20), | ||
(20, 2, 18), | ||
]) | ||
def test_transactions(my_wallet, earned, spent, expected): | ||
my_wallet.add_cash(earned) | ||
my_wallet.spend_cash(spent) | ||
assert my_wallet.balance == expected |
Empty file.