From ef92f79069f5cd6a2ba41da280b1056d7c786df6 Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Mon, 4 Mar 2024 22:26:55 +0800 Subject: [PATCH] fix tests --- tests/unit/ast/nodes/test_hex.py | 37 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/tests/unit/ast/nodes/test_hex.py b/tests/unit/ast/nodes/test_hex.py index b30f2b69d9..e161e3c160 100644 --- a/tests/unit/ast/nodes/test_hex.py +++ b/tests/unit/ast/nodes/test_hex.py @@ -9,37 +9,36 @@ foo: constant(address) = 0x6b175474e89094c44da98b954eedeac495271d0F """, """ -foo: constant(address[1]) = [0x6b175474e89094c44da98b954eedeac495271d0F] - """, - """ @external def foo(): bar: address = 0x6b175474e89094c44da98b954eedeac495271d0F """, - """ -@external -def foo(): - bar: address[1] = [0x6b175474e89094c44da98b954eedeac495271d0F] - """, - """ -@external -def foo(): - for i: address in [0x6b175474e89094c44da98b954eedeac495271d0F]: - pass - """, ] @pytest.mark.parametrize("code", code_invalid_checksum) def test_bad_checksum_address(code, dummy_input_bundle): - vyper_module = vy_ast.parse_to_ast(code) - with pytest.raises(BadChecksumAddress): - semantics.validate_semantics(vyper_module, dummy_input_bundle) + vyper_module = vy_ast.parse_to_ast(code) + semantics.analyze_module(vyper_module, dummy_input_bundle) code_invalid_literal = [ """ +foo: constant(address[1]) = [0x6b175474e89094c44da98b954eedeac495271d0F] + """, + """ +@external +def foo(): + for i: address in [0x6b175474e89094c44da98b954eedeac495271d0F]: + pass + """, + """ +@external +def foo(): + bar: address[1] = [0x6b175474e89094c44da98b954eedeac495271d0F] + """, + """ foo: constant(bytes20) = 0x6b175474e89094c44da98b954eedeac495271d0F """, """ @@ -50,8 +49,6 @@ def test_bad_checksum_address(code, dummy_input_bundle): @pytest.mark.parametrize("code", code_invalid_literal) def test_invalid_literal(code, dummy_input_bundle): - vyper_module = vy_ast.parse_to_ast(code) - with pytest.raises(InvalidLiteral): vyper_module = vy_ast.parse_to_ast(code) - semantics.validate_semantics(vyper_module, dummy_input_bundle) + semantics.analyze_module(vyper_module, dummy_input_bundle)