diff --git a/tests/functional/builtins/codegen/test_minmax_value.py b/tests/functional/builtins/codegen/test_minmax_value.py index 033381f59f..c5ee5c3584 100644 --- a/tests/functional/builtins/codegen/test_minmax_value.py +++ b/tests/functional/builtins/codegen/test_minmax_value.py @@ -1,6 +1,6 @@ import pytest -from vyper.exceptions import InvalidType, OverflowException +from vyper.exceptions import OverflowException, TypeMismatch from vyper.semantics.types import DecimalT, IntegerT from vyper.semantics.types.shortcuts import INT256_T, UINT256_T @@ -39,12 +39,12 @@ def foo(): if typ == UINT256_T: assert_compile_failed(lambda: get_contract(upper), OverflowException) else: - assert_compile_failed(lambda: get_contract(upper), InvalidType) + assert_compile_failed(lambda: get_contract(upper), TypeMismatch) if typ == INT256_T: assert_compile_failed(lambda: get_contract(lower), OverflowException) else: - assert_compile_failed(lambda: get_contract(lower), InvalidType) + assert_compile_failed(lambda: get_contract(lower), TypeMismatch) @pytest.mark.parametrize("typ", [DecimalT()]) diff --git a/tests/functional/codegen/types/numbers/test_signed_ints.py b/tests/functional/codegen/types/numbers/test_signed_ints.py index a10eaee408..e646a25354 100644 --- a/tests/functional/codegen/types/numbers/test_signed_ints.py +++ b/tests/functional/codegen/types/numbers/test_signed_ints.py @@ -5,7 +5,12 @@ import pytest from vyper import compile_code -from vyper.exceptions import InvalidOperation, InvalidType, OverflowException, ZeroDivisionException +from vyper.exceptions import ( + InvalidOperation, + OverflowException, + TypeMismatch, + ZeroDivisionException, +) from vyper.semantics.types import IntegerT from vyper.utils import evm_div, evm_mod @@ -214,7 +219,7 @@ def num_sub() -> {typ}: return 1-2**{typ.bits} """ - exc = OverflowException if typ.bits == 256 else InvalidType + exc = OverflowException if typ.bits == 256 else TypeMismatch with pytest.raises(exc): compile_code(code) @@ -331,7 +336,7 @@ def foo() -> {typ}: get_contract(code_2).foo(x) with tx_failed(): get_contract(code_3).foo(y) - with pytest.raises((InvalidType, OverflowException)): + with pytest.raises((TypeMismatch, OverflowException)): compile_code(code_4) @@ -430,5 +435,5 @@ def test_binop_nested_intermediate_underflow(): def foo(): a: int256 = -2**255 * 2 - 10 + 100 """ - with pytest.raises(InvalidType): + with pytest.raises(TypeMismatch): compile_code(code) diff --git a/tests/functional/codegen/types/numbers/test_unsigned_ints.py b/tests/functional/codegen/types/numbers/test_unsigned_ints.py index f10e861689..3f3fa32aba 100644 --- a/tests/functional/codegen/types/numbers/test_unsigned_ints.py +++ b/tests/functional/codegen/types/numbers/test_unsigned_ints.py @@ -5,7 +5,12 @@ import pytest from vyper import compile_code -from vyper.exceptions import InvalidOperation, InvalidType, OverflowException, ZeroDivisionException +from vyper.exceptions import ( + InvalidOperation, + OverflowException, + TypeMismatch, + ZeroDivisionException, +) from vyper.semantics.types import IntegerT from vyper.utils import SizeLimits, evm_div, evm_mod @@ -164,7 +169,7 @@ def foo() -> {typ}: get_contract(code_2).foo(x) with tx_failed(): get_contract(code_3).foo(y) - with pytest.raises((InvalidType, OverflowException)): + with pytest.raises((TypeMismatch, OverflowException)): get_contract(code_4) @@ -223,7 +228,7 @@ def test() -> {typ}: for val in bad_cases: exc = ( - InvalidType + TypeMismatch if SizeLimits.MIN_INT256 <= val <= SizeLimits.MAX_UINT256 else OverflowException )