From 9f667ca2d2f24a613c8e4446863a63b265251f9e Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:19:23 +0800 Subject: [PATCH] fix more tests --- .../codegen/features/test_logging.py | 14 +++++----- tests/functional/syntax/test_addmulmod.py | 6 ++--- tests/functional/syntax/test_ann_assign.py | 14 +++++----- tests/functional/syntax/test_as_wei_value.py | 4 +-- tests/functional/syntax/test_block.py | 8 +++--- tests/functional/syntax/test_bool.py | 6 ++--- tests/functional/syntax/test_bytes.py | 11 ++------ tests/functional/syntax/test_chainid.py | 20 ++++---------- tests/functional/syntax/test_concat.py | 4 +-- tests/functional/syntax/test_constants.py | 10 +++---- tests/functional/syntax/test_extract32.py | 2 +- tests/functional/syntax/test_invalids.py | 19 +++++++------- tests/functional/syntax/test_keccak256.py | 4 +-- tests/functional/syntax/test_list.py | 26 +++++++++---------- tests/functional/syntax/test_logging.py | 17 ++++-------- tests/functional/syntax/test_minmax.py | 2 +- tests/functional/syntax/test_nested_list.py | 8 +++--- tests/functional/syntax/test_selfdestruct.py | 4 +-- tests/functional/syntax/test_send.py | 12 ++++----- tests/functional/syntax/test_slice.py | 4 +-- tests/functional/syntax/test_structs.py | 3 +-- tests/functional/syntax/test_ternary.py | 6 ++--- 22 files changed, 89 insertions(+), 115 deletions(-) diff --git a/tests/functional/codegen/features/test_logging.py b/tests/functional/codegen/features/test_logging.py index 84311c41f5..f952d9749d 100644 --- a/tests/functional/codegen/features/test_logging.py +++ b/tests/functional/codegen/features/test_logging.py @@ -565,7 +565,7 @@ def foo_(): log MyLog(b'yo') """ - assert_tx_failed(lambda: get_contract_with_gas_estimation(loggy_code), InvalidType) + assert_tx_failed(lambda: get_contract_with_gas_estimation(loggy_code), TypeMismatch) def test_fails_when_topic_is_the_wrong_size(assert_tx_failed, get_contract_with_gas_estimation): @@ -579,7 +579,7 @@ def foo(): log MyLog(b'bars') """ - assert_tx_failed(lambda: get_contract_with_gas_estimation(loggy_code), InvalidType) + assert_tx_failed(lambda: get_contract_with_gas_estimation(loggy_code), TypeMismatch) def test_fails_when_input_topic_is_the_wrong_size( @@ -607,7 +607,7 @@ def foo(): log MyLog(b'bars') """ - assert_tx_failed(lambda: get_contract_with_gas_estimation(loggy_code), InvalidType) + assert_tx_failed(lambda: get_contract_with_gas_estimation(loggy_code), TypeMismatch) def test_fails_when_input_data_is_the_wrong_size( @@ -1236,7 +1236,7 @@ def foo(): def foo(): raw_log([1, 2], b"moo") """, - InvalidType, + TypeMismatch, ), ( """ @@ -1244,7 +1244,7 @@ def foo(): def foo(): raw_log([1, 2], b"moo") """, - InvalidType, + TypeMismatch, ), ( """ @@ -1261,7 +1261,7 @@ def foo(): def foo(): raw_log([b"cow"], b"dog") """, - (StructureException, InvalidType), + (StructureException, TypeMismatch), ), ( """ @@ -1270,7 +1270,7 @@ def foo(): # bytes20 instead of bytes32 raw_log([], 0x1234567890123456789012345678901234567890) """, - InvalidType, + TypeMismatch, ), ] diff --git a/tests/functional/syntax/test_addmulmod.py b/tests/functional/syntax/test_addmulmod.py index ddff4d3e01..9a1ff30808 100644 --- a/tests/functional/syntax/test_addmulmod.py +++ b/tests/functional/syntax/test_addmulmod.py @@ -1,6 +1,6 @@ import pytest -from vyper.exceptions import InvalidType +from vyper.exceptions import TypeMismatch fail_list = [ ( # bad AST nodes given as arguments @@ -9,7 +9,7 @@ def foo() -> uint256: return uint256_addmod(1.1, 1.2, 3.0) """, - InvalidType, + TypeMismatch, ), ( # bad AST nodes given as arguments """ @@ -17,7 +17,7 @@ def foo() -> uint256: def foo() -> uint256: return uint256_mulmod(1.1, 1.2, 3.0) """, - InvalidType, + TypeMismatch, ), ] diff --git a/tests/functional/syntax/test_ann_assign.py b/tests/functional/syntax/test_ann_assign.py index b5c1f6a752..7fdb1328c2 100644 --- a/tests/functional/syntax/test_ann_assign.py +++ b/tests/functional/syntax/test_ann_assign.py @@ -4,7 +4,7 @@ from vyper import compiler from vyper.exceptions import ( InvalidAttribute, - InvalidType, + TypeMismatch, UndeclaredDefinition, UnknownAttribute, VariableDeclarationException, @@ -41,7 +41,7 @@ def test(): def test(): a: int128 = 33.33 """, - InvalidType, + TypeMismatch, ), ( """ @@ -50,7 +50,7 @@ def data() -> int128: s: int128[5] = [1, 2, 3, 4, 5, 6] return 235357 """, - InvalidType, + TypeMismatch, ), ( """ @@ -62,7 +62,7 @@ def foo() -> int128: s: S = S({a: 1.2, b: 1}) return s.a """, - InvalidType, + TypeMismatch, ), ( """ @@ -105,7 +105,7 @@ def foo() -> bool: a: uint256 = -1 return True """, - InvalidType, + TypeMismatch, ), ( """ @@ -114,7 +114,7 @@ def foo() -> bool: a: uint256[2] = [13, -42] return True """, - InvalidType, + TypeMismatch, ), ( """ @@ -123,7 +123,7 @@ def foo() -> bool: a: int128 = 170141183460469231731687303715884105728 return True """, - InvalidType, + TypeMismatch, ), ] diff --git a/tests/functional/syntax/test_as_wei_value.py b/tests/functional/syntax/test_as_wei_value.py index a5232a5c9a..a167f71bd1 100644 --- a/tests/functional/syntax/test_as_wei_value.py +++ b/tests/functional/syntax/test_as_wei_value.py @@ -1,6 +1,6 @@ import pytest -from vyper.exceptions import ArgumentException, InvalidType, StructureException +from vyper.exceptions import ArgumentException, StructureException fail_list = [ ( @@ -26,7 +26,7 @@ def foo() -> int128: def foo(): x: int128 = as_wei_value(0xf5, "szabo") """, - InvalidType, + TypeMismatch, ), ] diff --git a/tests/functional/syntax/test_block.py b/tests/functional/syntax/test_block.py index 1e6bfcf0e2..8d8bffb697 100644 --- a/tests/functional/syntax/test_block.py +++ b/tests/functional/syntax/test_block.py @@ -2,7 +2,7 @@ from pytest import raises from vyper import compiler -from vyper.exceptions import InvalidType, TypeMismatch +from vyper.exceptions import TypeMismatch fail_list = [ ( @@ -11,7 +11,7 @@ def foo() -> int128[2]: return [3,block.timestamp] """, - InvalidType, + TypeMismatch, ), ( """ @@ -19,7 +19,7 @@ def foo() -> int128[2]: def foo() -> int128[2]: return [block.timestamp - block.timestamp, block.timestamp] """, - InvalidType, + TypeMismatch, ), """ @external @@ -34,7 +34,7 @@ def foo() -> decimal: def foo(): x: Bytes[10] = slice(b"cow", -1, block.timestamp) """, - InvalidType, + TypeMismatch, ), """ @external diff --git a/tests/functional/syntax/test_bool.py b/tests/functional/syntax/test_bool.py index 48ed37321a..7842ab7628 100644 --- a/tests/functional/syntax/test_bool.py +++ b/tests/functional/syntax/test_bool.py @@ -2,7 +2,7 @@ from pytest import raises from vyper import compiler -from vyper.exceptions import InvalidOperation, InvalidType, SyntaxException, TypeMismatch +from vyper.exceptions import InvalidOperation, SyntaxException, TypeMismatch fail_list = [ ( @@ -12,7 +12,7 @@ def foo(): x: bool = True x = 5 """, - InvalidType, + TypeMismatch, ), ( """ @@ -29,7 +29,7 @@ def foo(): x: bool = True x = 129 """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_bytes.py b/tests/functional/syntax/test_bytes.py index a7fb7e77ce..da62e9e6ef 100644 --- a/tests/functional/syntax/test_bytes.py +++ b/tests/functional/syntax/test_bytes.py @@ -3,7 +3,6 @@ from vyper import compiler from vyper.exceptions import ( InvalidOperation, - InvalidType, StructureException, SyntaxException, TypeMismatch, @@ -56,24 +55,18 @@ def foo(x: Bytes[100]) -> int128: def foo(x: int128) -> Bytes[75]: return x """, - ( - """ + """ @external def foo() -> Bytes[10]: x: Bytes[10] = '0x1234567890123456789012345678901234567890' x = 0x1234567890123456789012345678901234567890 return x """, - InvalidType, - ), - ( - """ + """ @external def foo() -> Bytes[10]: return "badmintonzz" """, - InvalidType, - ), ( """ @external diff --git a/tests/functional/syntax/test_chainid.py b/tests/functional/syntax/test_chainid.py index 2b6e08cbc4..7bfc798154 100644 --- a/tests/functional/syntax/test_chainid.py +++ b/tests/functional/syntax/test_chainid.py @@ -3,7 +3,7 @@ from vyper import compiler from vyper.compiler.settings import Settings from vyper.evm.opcodes import EVM_VERSIONS -from vyper.exceptions import InvalidType, TypeMismatch +from vyper.exceptions import TypeMismatch @pytest.mark.parametrize("evm_version", list(EVM_VERSIONS)) @@ -19,14 +19,11 @@ def foo(): fail_list = [ - ( - """ + """ @external def foo() -> int128[2]: return [3,chain.id] """, - InvalidType, - ), """ @external def foo() -> decimal: @@ -54,25 +51,18 @@ def add_record(): def add_record(): self.a[chain.id] = chain.id + 20 """, - ( - """ + """ @external def foo(inp: Bytes[10]) -> Bytes[3]: return slice(inp, chain.id, -3) """, - InvalidType, - ), ] @pytest.mark.parametrize("bad_code", fail_list) def test_chain_fail(bad_code): - if isinstance(bad_code, tuple): - with pytest.raises(bad_code[1]): - compiler.compile_code(bad_code[0]) - else: - with pytest.raises(TypeMismatch): - compiler.compile_code(bad_code) + with pytest.raises(TypeMismatch): + compiler.compile_code(bad_code) valid_list = [ diff --git a/tests/functional/syntax/test_concat.py b/tests/functional/syntax/test_concat.py index e128e7c6ae..8431e5ecf2 100644 --- a/tests/functional/syntax/test_concat.py +++ b/tests/functional/syntax/test_concat.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import ArgumentException, InvalidType, TypeMismatch +from vyper.exceptions import ArgumentException, TypeMismatch fail_list = [ ( @@ -18,7 +18,7 @@ def cat(i1: Bytes[10], i2: Bytes[30]) -> Bytes[40]: def cat(i1: Bytes[10], i2: Bytes[30]) -> Bytes[40]: return concat(i1, 5) """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_constants.py b/tests/functional/syntax/test_constants.py index ffd2f1faa0..c3eb4aad52 100644 --- a/tests/functional/syntax/test_constants.py +++ b/tests/functional/syntax/test_constants.py @@ -5,11 +5,11 @@ from vyper.exceptions import ( ArgumentException, ImmutableViolation, - InvalidType, NamespaceCollision, StateAccessViolation, StructureException, SyntaxException, + TypeMismatch, VariableDeclarationException, ) @@ -33,16 +33,16 @@ """ VAL: constant(uint256) = "test" """, - InvalidType, + TypeMismatch, ), # invalid range ( """ VAL: constant(uint256) = -1 """, - InvalidType, + TypeMismatch, ), - # reserverd keyword + # reserved keyword ( """ wei: constant(uint256) = 1 @@ -62,7 +62,7 @@ """ VAL: constant(Bytes[4]) = b"testtest" """, - InvalidType, + TypeMismatch, ), # global with same name ( diff --git a/tests/functional/syntax/test_extract32.py b/tests/functional/syntax/test_extract32.py index b04c8b8742..caec38e5d1 100644 --- a/tests/functional/syntax/test_extract32.py +++ b/tests/functional/syntax/test_extract32.py @@ -34,7 +34,7 @@ def foo(inp: Bytes[32]) -> int128: def foo(inp: Bytes[32]) -> int128: return extract32(inp, -1, output_type=int128) """, - InvalidType, # `start` cannot be negative + TypeMismatch, # `start` cannot be negative ), ( """ diff --git a/tests/functional/syntax/test_invalids.py b/tests/functional/syntax/test_invalids.py index 33478fcff1..dfc74fc75b 100644 --- a/tests/functional/syntax/test_invalids.py +++ b/tests/functional/syntax/test_invalids.py @@ -4,7 +4,6 @@ from vyper.exceptions import ( FunctionDeclarationException, InvalidOperation, - InvalidType, StructureException, TypeMismatch, UndeclaredDefinition, @@ -67,7 +66,7 @@ def foo(): x: int128 = 5 x = 0x1234567890123456789012345678901234567890 """, - InvalidType, + TypeMismatch, ) must_fail( @@ -77,7 +76,7 @@ def foo(): x: int128 = 5 x = 3.5 """, - InvalidType, + TypeMismatch, ) must_succeed( @@ -105,7 +104,7 @@ def foo(): def foo(): self.b = 7.5 """, - InvalidType, + TypeMismatch, ) must_succeed( @@ -133,7 +132,7 @@ def foo(): def foo(): self.b = 7 """, - InvalidType, + TypeMismatch, ) must_succeed( @@ -152,7 +151,7 @@ def foo(): def foo(): x: int128 = self.b[-5] """, - InvalidType, + TypeMismatch, ) must_fail( @@ -162,7 +161,7 @@ def foo(): def foo(): x: int128 = self.b[5.7] """, - InvalidType, + TypeMismatch, ) must_succeed( @@ -181,7 +180,7 @@ def foo(): def foo(): self.b[3] = 5.6 """, - InvalidType, + TypeMismatch, ) must_succeed( @@ -236,7 +235,7 @@ def foo(): def foo(): self.bar = 5 """, - InvalidType, + TypeMismatch, ) must_succeed( @@ -254,7 +253,7 @@ def foo(): def foo() -> address: return [1, 2, 3] """, - InvalidType, + TypeMismatch, ) must_fail( diff --git a/tests/functional/syntax/test_keccak256.py b/tests/functional/syntax/test_keccak256.py index 70d33edcf2..68253c8121 100644 --- a/tests/functional/syntax/test_keccak256.py +++ b/tests/functional/syntax/test_keccak256.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidType, UndeclaredDefinition +from vyper.exceptions import TypeMismatch, UndeclaredDefinition type_fail_list = [ """ @@ -14,7 +14,7 @@ def foo(): @pytest.mark.parametrize("bad_code", type_fail_list) def test_block_type_fail(bad_code): - with pytest.raises(InvalidType): + with pytest.raises(TypeMismatch): compiler.compile_code(bad_code) diff --git a/tests/functional/syntax/test_list.py b/tests/functional/syntax/test_list.py index db41de5526..8bc0b686a2 100644 --- a/tests/functional/syntax/test_list.py +++ b/tests/functional/syntax/test_list.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidLiteral, InvalidType, StructureException, TypeMismatch +from vyper.exceptions import InvalidLiteral, StructureException, TypeMismatch fail_list = [ ( @@ -11,7 +11,7 @@ def foo(): x: int128[3] = [1, 2, 3] x = 4 """, - InvalidType, + TypeMismatch, ), ( """ @@ -20,7 +20,7 @@ def foo(): x: int128[3] = [1, 2, 3] x = [4, 5, 6, 7] """, - InvalidType, + TypeMismatch, ), ( """ @@ -28,7 +28,7 @@ def foo(): def foo() -> int128[2]: return [3, 5, 7] """, - InvalidType, + TypeMismatch, ), ( """ @@ -36,7 +36,7 @@ def foo() -> int128[2]: def foo() -> int128[2]: return [3] """, - InvalidType, + TypeMismatch, ), ( """ @@ -94,7 +94,7 @@ def foo(): def foo(): self.bar = [] """, - InvalidType, + TypeMismatch, ), ( """ @@ -121,7 +121,7 @@ def foo(): def foo(): self.bar = 5 """, - InvalidType, + TypeMismatch, ), ( """ @@ -130,7 +130,7 @@ def foo(): def foo(): self.bar = [2, 5] """, - InvalidType, + TypeMismatch, ), ( """ @@ -139,7 +139,7 @@ def foo(): def foo(): self.bar = [1, 2, 3, 4] """, - InvalidType, + TypeMismatch, ), ( """ @@ -148,7 +148,7 @@ def foo(): def foo(): self.bar = [1, 2] """, - InvalidType, + TypeMismatch, ), ( """ @@ -157,7 +157,7 @@ def foo(): def foo(): self.b[0] = 7.5 """, - InvalidType, + TypeMismatch, ), ( """ @@ -176,7 +176,7 @@ def foo()->bool[2]: a[0] = 1 return a """, - InvalidType, + TypeMismatch, ), ( """ @@ -186,7 +186,7 @@ def foo()->bool[2]: a[0] = 1 return a """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_logging.py b/tests/functional/syntax/test_logging.py index 2dd21e7a92..6c6e76a28c 100644 --- a/tests/functional/syntax/test_logging.py +++ b/tests/functional/syntax/test_logging.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidType, StructureException, TypeMismatch +from vyper.exceptions import StructureException, TypeMismatch fail_list = [ """ @@ -23,28 +23,21 @@ def foo(): x: decimal[4] = [0.0, 0.0, 0.0, 0.0] log Bar(x) """, - ( - """ + """ event Test: n: uint256 @external def test(): log Test(-7) - """, - InvalidType, - ), + """ ] @pytest.mark.parametrize("bad_code", fail_list) def test_logging_fail(bad_code): - if isinstance(bad_code, tuple): - with pytest.raises(bad_code[1]): - compiler.compile_code(bad_code[0]) - else: - with pytest.raises(TypeMismatch): - compiler.compile_code(bad_code) + with pytest.raises(TypeMismatch): + compiler.compile_code(bad_code) @pytest.mark.parametrize("mutability", ["@pure", "@view"]) diff --git a/tests/functional/syntax/test_minmax.py b/tests/functional/syntax/test_minmax.py index 2ad3d363f1..2d9598acb3 100644 --- a/tests/functional/syntax/test_minmax.py +++ b/tests/functional/syntax/test_minmax.py @@ -9,7 +9,7 @@ def foo(): y: int128 = min(7, 0x1234567890123456789012345678901234567890) """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_nested_list.py b/tests/functional/syntax/test_nested_list.py index a5f01274cf..dbc411b495 100644 --- a/tests/functional/syntax/test_nested_list.py +++ b/tests/functional/syntax/test_nested_list.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidLiteral, InvalidType, TypeMismatch +from vyper.exceptions import InvalidLiteral, TypeMismatch fail_list = [ ( @@ -11,7 +11,7 @@ def foo(): self.bar = [[1, 2], [3, 4, 5], [6, 7, 8]] """, - InvalidType, # casting darray to sarray + TypeMismatch, # casting darray to sarray ), ( """ @@ -28,7 +28,7 @@ def foo(): def foo() -> int128[2]: return [[1,2],[3,4]] """, - InvalidType, + TypeMismatch, ), ( """ @@ -36,7 +36,7 @@ def foo() -> int128[2]: def foo() -> int128[2][2]: return [1,2] """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_selfdestruct.py b/tests/functional/syntax/test_selfdestruct.py index 8f80a56ce1..9f55dca56b 100644 --- a/tests/functional/syntax/test_selfdestruct.py +++ b/tests/functional/syntax/test_selfdestruct.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidType +from vyper.exceptions import TypeMismatch fail_list = [ """ @@ -14,7 +14,7 @@ def foo(): @pytest.mark.parametrize("bad_code", fail_list) def test_block_fail(bad_code): - with pytest.raises(InvalidType): + with pytest.raises(TypeMismatch): compiler.compile_code(bad_code) diff --git a/tests/functional/syntax/test_send.py b/tests/functional/syntax/test_send.py index 15ec19f770..ffad1b3792 100644 --- a/tests/functional/syntax/test_send.py +++ b/tests/functional/syntax/test_send.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidType, TypeMismatch +from vyper.exceptions import TypeMismatch fail_list = [ ( @@ -10,7 +10,7 @@ def foo(): send(1, 2) """, - InvalidType, + TypeMismatch, ), ( """ @@ -18,7 +18,7 @@ def foo(): def foo(): send(0x1234567890123456789012345678901234567890, 2.5) """, - InvalidType, + TypeMismatch, ), ( """ @@ -26,7 +26,7 @@ def foo(): def foo(): send(0x1234567890123456789012345678901234567890, 0x1234567890123456789012345678901234567890) """, - InvalidType, + TypeMismatch, ), ( """ @@ -65,7 +65,7 @@ def foo(): def foo(): send(0x1234567890123456789012345678901234567890, 5, gas=1.5) """, - InvalidType, + TypeMismatch, ), ( """ @@ -73,7 +73,7 @@ def foo(): def foo(): send(0x1234567890123456789012345678901234567890, 5, gas=-2) """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_slice.py b/tests/functional/syntax/test_slice.py index 8fe162fc2b..6bb666527e 100644 --- a/tests/functional/syntax/test_slice.py +++ b/tests/functional/syntax/test_slice.py @@ -1,7 +1,7 @@ import pytest from vyper import compiler -from vyper.exceptions import InvalidType, TypeMismatch +from vyper.exceptions import TypeMismatch fail_list = [ ( @@ -26,7 +26,7 @@ def foo(inp: int128) -> Bytes[3]: def foo(inp: Bytes[10]) -> Bytes[3]: return slice(inp, 4.0, 3) """, - InvalidType, + TypeMismatch, ), ] diff --git a/tests/functional/syntax/test_structs.py b/tests/functional/syntax/test_structs.py index b30f7e6098..4fad35d1d4 100644 --- a/tests/functional/syntax/test_structs.py +++ b/tests/functional/syntax/test_structs.py @@ -3,7 +3,6 @@ from vyper import compiler from vyper.exceptions import ( InstantiationException, - InvalidType, StructureException, TypeMismatch, UnknownAttribute, @@ -254,7 +253,7 @@ def foo(): def foo(): self.mom = Mom({a: self.nom, b: 5.5}) """, - InvalidType, + TypeMismatch, ), ( """ diff --git a/tests/functional/syntax/test_ternary.py b/tests/functional/syntax/test_ternary.py index 325be3e43b..6382a144a3 100644 --- a/tests/functional/syntax/test_ternary.py +++ b/tests/functional/syntax/test_ternary.py @@ -1,7 +1,7 @@ import pytest from vyper.compiler import compile_code -from vyper.exceptions import InvalidType, TypeMismatch +from vyper.exceptions import TypeMismatch good_list = [ # basic test @@ -73,7 +73,7 @@ def test_ternary_good(code): def foo() -> uint256: return 1 if 1 else 2 """, - InvalidType, + TypeMismatch, ), ( # bad test type: constant """ @@ -82,7 +82,7 @@ def foo() -> uint256: def foo() -> uint256: return 1 if TEST else 2 """, - InvalidType, + TypeMismatch, ), ( # bad test type: variable """