Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Dec 21, 2023
1 parent cd07723 commit 0abe8cc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from eth.codecs import abi

from vyper import compile_code
from vyper.exceptions import (
ArgumentException,
InvalidType,
Expand Down Expand Up @@ -1158,8 +1159,8 @@ def test_invalid_contract_reference_call(tx_failed, get_contract):
def bar(arg1: address, arg2: int128) -> int128:
return Foo(arg1).foo(arg2)
"""
with tx_failed(exception=UndeclaredDefinition):
get_contract(contract)
with pytest.raises(UndeclaredDefinition):
compile_code(contract)


def test_invalid_contract_reference_return_type(tx_failed, get_contract):
Expand All @@ -1171,8 +1172,8 @@ def foo(arg2: int128) -> invalid: view
def bar(arg1: address, arg2: int128) -> int128:
return Foo(arg1).foo(arg2)
"""
with tx_failed(exception=UnknownType):
get_contract(contract)
with pytest.raises(UnknownType):
compile_code(contract)


def test_external_contract_call_declaration_expr(get_contract):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pytest

from vyper import compile_code
from vyper.exceptions import TypeMismatch

pytestmark = pytest.mark.usefixtures("memory_mocker")
Expand Down Expand Up @@ -158,5 +159,5 @@ def test_tuple_return_typecheck(tx_failed, get_contract_with_gas_estimation):
def getTimeAndBalance() -> (bool, address):
return block.timestamp, self.balance
"""
with tx_failed(TypeMismatch):
get_contract_with_gas_estimation(code)
with pytest.raises(TypeMismatch):
compile_code(code)

0 comments on commit 0abe8cc

Please sign in to comment.