Skip to content

Commit

Permalink
add parametrized test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Oct 2, 2019
1 parent f6592b6 commit 7654173
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/test_approve_transferFrom.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ def test_transferFrom(token, accounts):
assert token.allowance(accounts[0], accounts[1]) == "1 ether"


def test_transferFrom_reverts(token, accounts):
@pytest.mark.parametrize('idx', [0, 1, 2])
def test_transferFrom_reverts(token, accounts, idx):
'''transerFrom should revert'''
with pytest.reverts("Insufficient allowance"):
token.transferFrom(accounts[0], accounts[2], "1 ether", {'from': accounts[1]})

with pytest.reverts("Insufficient allowance"):
token.transferFrom(accounts[0], accounts[2], "1 ether", {'from': accounts[0]})
token.transferFrom(accounts[0], accounts[2], "1 ether", {'from': accounts[idx]})

0 comments on commit 7654173

Please sign in to comment.