Skip to content

Commit

Permalink
add multiple contracts parametrization example
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Feb 28, 2022
1 parent 9f0f32d commit 1ba2617
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions tests/parser/syntax/constants/test_constantGetter2_Success.vy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VAL: constant(int128) = -123

@external
def foo() -> int128:
return VAL
11 changes: 8 additions & 3 deletions tests/parser/syntax/test_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,12 @@ def test_constant_success(good_code):


@pytest.mark.parametrize(
"vyper_contract", ["constants/test_constantGetter1_Success.vy"], indirect=True
"vyper_contract,return_value",
[
["constants/test_constantGetter1_Success.vy", 123],
["constants/test_constantGetter2_Success.vy", -123],
],
indirect=True,
)
def test_constant_success_2(vyper_contract):
assert vyper_contract.foo() == 123
def test_constant_success_2(vyper_contract, return_value):
assert vyper_contract.foo() == return_value

0 comments on commit 1ba2617

Please sign in to comment.