From 4dd47e302fc538ca4fc6fe29d992f0b59456f8e2 Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Wed, 8 Nov 2023 14:38:19 -0500 Subject: [PATCH] refactor: test directory structure (#3664) refactor: test directory structure - consolidate a bunch of different directories - move files around - merge `conftest.py` and `base_conftest.py` - better organization - unit/ vs functional/ tests - rename old `parser/` and `parser_utils/` directories there is still more refactoring that could be done, and probably some files could be merged / specific tests in files could be moved around, but this commit tried to only touch the directory structure for the sake of reducing merge conflicts in PRs which are still open --- tests/base_conftest.py | 217 ------------- tests/conftest.py | 284 +++++++++++++++--- tests/{compiler/ir => functional}/__init__.py | 0 .../builtins/codegen}/__init__.py | 0 .../builtins/codegen}/test_abi.py | 0 .../builtins/codegen}/test_abi_decode.py | 0 .../builtins/codegen}/test_abi_encode.py | 0 .../builtins/codegen}/test_addmod.py | 0 .../builtins/codegen}/test_as_wei_value.py | 33 ++ .../builtins/codegen}/test_bitwise.py | 0 .../builtins/codegen}/test_ceil.py | 0 .../builtins/codegen}/test_concat.py | 0 .../builtins/codegen}/test_convert.py | 0 .../codegen}/test_create_functions.py | 0 .../builtins/codegen}/test_ec.py | 0 .../builtins/codegen}/test_ecrecover.py | 0 .../builtins/codegen}/test_empty.py | 0 .../builtins/codegen}/test_extract32.py | 0 .../builtins/codegen}/test_floor.py | 0 .../builtins/codegen}/test_interfaces.py | 0 .../builtins/codegen}/test_is_contract.py | 0 .../builtins/codegen}/test_keccak256.py | 0 .../builtins/codegen}/test_length.py | 0 .../builtins/codegen}/test_method_id.py | 0 .../builtins/codegen}/test_minmax.py | 0 .../builtins/codegen}/test_minmax_value.py | 0 .../builtins/codegen}/test_mulmod.py | 0 .../builtins/codegen}/test_raw_call.py | 0 .../builtins/codegen}/test_send.py | 0 .../builtins/codegen}/test_sha256.py | 0 .../builtins/codegen}/test_slice.py | 0 .../builtins/codegen/test_uint2str.py} | 0 .../builtins/codegen}/test_unary.py | 0 .../builtins/codegen}/test_unsafe_math.py | 0 .../builtins/folding/test_abs.py | 0 .../builtins/folding/test_addmod_mulmod.py | 0 .../builtins/folding/test_bitwise.py | 0 .../builtins/folding/test_epsilon.py | 0 .../builtins/folding/test_floor_ceil.py | 0 .../folding/test_fold_as_wei_value.py | 0 .../builtins/folding/test_keccak_sha.py | 0 .../builtins/folding/test_len.py | 0 .../builtins/folding/test_min_max.py | 0 .../builtins/folding/test_powmod.py | 0 .../codegen}/__init__.py | 0 .../test_default_function.py | 0 .../test_default_parameters.py | 0 .../calling_convention}/test_erc20_abi.py | 0 .../test_external_contract_calls.py | 0 ...test_modifiable_external_contract_calls.py | 0 .../calling_convention}/test_return.py | 0 .../calling_convention}/test_return_struct.py | 0 .../calling_convention}/test_return_tuple.py | 0 .../test_self_call_struct.py | 0 .../test_struct_return.py | 0 .../test_tuple_return.py | 0 .../test_block_number.py | 0 .../environment_variables/test_blockhash.py} | 0 .../codegen/environment_variables}/test_tx.py | 0 .../features/decorators/test_nonreentrant.py | 0 .../features/decorators/test_payable.py | 0 .../features/decorators/test_private.py | 0 .../features/decorators/test_public.py | 0 .../codegen}/features/decorators/test_pure.py | 0 .../codegen}/features/decorators/test_view.py | 0 .../codegen}/features/iteration/test_break.py | 0 .../features/iteration/test_continue.py | 0 .../features/iteration/test_for_in_list.py | 0 .../features/iteration/test_for_range.py | 0 .../features/iteration/test_range_in.py | 0 .../codegen}/features/test_address_balance.py | 0 .../codegen}/features/test_assert.py | 0 .../features/test_assert_unreachable.py | 0 .../codegen}/features/test_assignment.py | 0 .../codegen}/features/test_bytes_map_keys.py | 0 .../codegen}/features/test_clampers.py | 0 .../codegen}/features/test_comments.py | 0 .../codegen}/features/test_comparison.py | 0 .../codegen}/features/test_conditionals.py | 0 .../codegen}/features/test_constructor.py | 0 .../codegen}/features/test_gas.py | 0 .../codegen}/features/test_immutable.py | 0 .../codegen}/features/test_init.py | 0 .../codegen}/features/test_internal_call.py | 0 .../codegen}/features/test_logging.py | 0 .../features/test_logging_bytes_extended.py | 0 .../features/test_logging_from_call.py | 0 .../codegen}/features/test_memory_alloc.py | 0 .../codegen}/features/test_memory_dealloc.py | 0 .../codegen}/features/test_packing.py | 0 .../codegen}/features/test_reverting.py | 0 .../features/test_short_circuiting.py | 0 .../codegen}/features/test_string_map_keys.py | 0 .../codegen}/features/test_ternary.py | 0 .../codegen}/features/test_transient.py | 0 .../codegen}/integration/test_basics.py | 0 .../codegen}/integration/test_crowdfund.py | 1 + .../codegen}/integration/test_escrow.py | 0 .../storage_variables}/test_getters.py | 0 .../storage_variables}/test_setters.py | 0 .../test_storage_variable.py} | 0 .../codegen}/test_call_graph_stability.py | 0 .../codegen}/test_selector_table.py | 0 .../codegen}/test_selector_table_stability.py | 0 .../codegen}/types/numbers/test_constants.py | 0 .../codegen}/types/numbers/test_decimals.py | 0 .../codegen/types/numbers}/test_division.py | 0 .../codegen/types/numbers}/test_exponents.py | 0 .../codegen}/types/numbers/test_isqrt.py | 0 .../codegen/types/numbers}/test_modulo.py | 0 .../types/numbers/test_signed_ints.py | 0 .../codegen}/types/numbers/test_sqrt.py | 0 .../types/numbers/test_unsigned_ints.py | 0 .../codegen}/types/test_bytes.py | 0 .../codegen}/types/test_bytes_literal.py | 0 .../codegen}/types/test_bytes_zero_padding.py | 0 .../codegen}/types/test_dynamic_array.py | 0 .../codegen}/types/test_enum.py | 0 .../codegen}/types/test_identifier_naming.py | 0 .../codegen}/types/test_lists.py | 0 .../codegen}/types/test_node_types.py | 0 .../codegen}/types/test_string.py | 0 .../codegen}/types/test_string_literal.py | 0 .../examples/auctions/test_blind_auction.py | 0 .../auctions/test_simple_open_auction.py | 0 .../examples/company/test_company.py | 0 tests/{ => functional}/examples/conftest.py | 0 .../crowdfund/test_crowdfund_example.py | 0 .../examples/factory/test_factory.py | 0 .../test_on_chain_market_maker.py | 0 .../name_registry/test_name_registry.py | 0 .../test_safe_remote_purchase.py | 0 .../examples/storage/test_advanced_storage.py | 0 .../examples/storage/test_storage.py | 0 .../examples/tokens/test_erc1155.py | 0 .../examples/tokens/test_erc20.py | 0 .../examples/tokens/test_erc4626.py | 0 .../examples/tokens/test_erc721.py | 0 .../examples/voting/test_ballot.py | 0 .../examples/wallet/test_wallet.py | 0 .../{ => functional}/grammar/test_grammar.py | 0 .../{parser => functional}/syntax/__init__.py | 0 .../exceptions/test_argument_exception.py | 0 .../syntax}/exceptions/test_call_violation.py | 0 .../exceptions/test_constancy_exception.py | 0 .../test_function_declaration_exception.py | 0 .../test_instantiation_exception.py | 0 .../test_invalid_literal_exception.py | 0 .../exceptions/test_invalid_payable.py | 0 .../exceptions/test_invalid_reference.py | 0 .../exceptions/test_invalid_type_exception.py | 0 .../exceptions/test_namespace_collision.py | 0 .../exceptions/test_overflow_exception.py | 0 .../exceptions/test_structure_exception.py | 0 .../exceptions/test_syntax_exception.py | 0 .../test_type_mismatch_exception.py | 0 .../exceptions/test_undeclared_definition.py | 0 .../test_variable_declaration_exception.py | 0 .../exceptions/test_vyper_exception_pos.py | 0 .../syntax/names}/test_event_names.py | 0 .../syntax/names}/test_function_names.py | 0 .../syntax/names}/test_variable_names.py | 0 .../test_invalid_function_decorators.py | 0 .../signatures/test_method_id_conflicts.py | 0 .../syntax/test_abi_decode.py | 0 .../syntax/test_abi_encode.py | 0 .../syntax/test_addmulmod.py | 0 .../syntax/test_address_code.py | 0 .../syntax/test_ann_assign.py | 0 .../syntax/test_as_uint256.py | 0 .../syntax/test_as_wei_value.py | 0 .../syntax/test_block.py | 0 .../syntax/test_blockscope.py | 0 .../syntax/test_bool.py | 0 .../syntax/test_bool_ops.py | 0 .../syntax/test_bytes.py | 0 .../syntax/test_chainid.py | 0 .../syntax/test_code_size.py | 0 .../syntax/test_codehash.py | 0 .../syntax/test_concat.py | 0 .../syntax/test_conditionals.py | 0 .../syntax/test_constants.py | 0 .../syntax/test_create_with_code_of.py | 0 .../syntax/test_dynamic_array.py | 0 .../syntax/test_enum.py | 0 .../syntax/test_extract32.py | 0 .../syntax/test_for_range.py | 0 .../syntax/test_functions_call.py | 0 .../syntax/test_immutables.py | 0 .../syntax/test_interfaces.py | 0 .../syntax/test_invalids.py | 0 .../syntax/test_keccak256.py | 0 .../{parser => functional}/syntax/test_len.py | 0 .../syntax/test_list.py | 0 .../syntax/test_logging.py | 0 .../syntax/test_minmax.py | 0 .../syntax/test_minmax_value.py | 0 .../syntax/test_msg_data.py | 0 .../syntax/test_nested_list.py | 0 .../syntax/test_no_none.py | 0 .../syntax/test_print.py | 0 .../syntax/test_public.py | 0 .../syntax/test_raw_call.py | 0 .../syntax/test_return_tuple.py | 0 .../syntax/test_self_balance.py | 0 .../syntax/test_selfdestruct.py | 0 .../syntax/test_send.py | 0 .../syntax/test_slice.py | 0 .../syntax/test_string.py | 0 .../syntax/test_structs.py | 0 .../syntax/test_ternary.py | 0 .../syntax/test_tuple_assign.py | 0 .../syntax/test_unbalanced_return.py | 0 tests/parser/functions/test_as_wei_value.py | 31 -- tests/unit/__init__.py | 0 .../abi_types/test_invalid_abi_types.py | 0 tests/{ => unit}/ast/nodes/test_binary.py | 0 .../ast/nodes/test_compare_nodes.py | 0 .../ast/nodes/test_evaluate_binop_decimal.py | 0 .../ast/nodes/test_evaluate_binop_int.py | 0 .../ast/nodes/test_evaluate_boolop.py | 0 .../ast/nodes/test_evaluate_compare.py | 0 .../ast/nodes/test_evaluate_subscript.py | 0 .../ast/nodes/test_evaluate_unaryop.py | 0 tests/{ => unit}/ast/nodes/test_from_node.py | 0 .../{ => unit}/ast/nodes/test_get_children.py | 0 .../ast/nodes/test_get_descendants.py | 0 tests/{ => unit}/ast/nodes/test_hex.py | 0 .../ast/nodes/test_replace_in_tree.py | 0 .../ast}/test_annotate_and_optimize_ast.py | 0 .../ast_utils => unit/ast}/test_ast_dict.py | 0 tests/{ => unit}/ast/test_folding.py | 0 tests/{ => unit}/ast/test_metadata_journal.py | 0 tests/{ => unit}/ast/test_natspec.py | 0 .../test_ast.py => unit/ast/test_parser.py} | 0 tests/{ => unit}/ast/test_pre_parser.py | 0 .../ast/test_source_annotation.py} | 0 .../cli/outputs/test_storage_layout.py | 0 .../outputs/test_storage_layout_overrides.py | 0 .../cli/vyper_compile/test_compile_files.py | 0 .../cli/vyper_compile/test_parse_args.py | 0 .../cli/vyper_json/test_compile_json.py | 0 .../cli/vyper_json/test_get_inputs.py | 0 .../cli/vyper_json/test_get_settings.py | 0 .../cli/vyper_json/test_output_selection.py | 0 .../vyper_json/test_parse_args_vyperjson.py | 0 tests/{ => unit}/compiler/__init__.py | 0 .../compiler/asm/test_asm_optimizer.py | 0 tests/unit/compiler/ir/__init__.py | 0 .../compiler/ir}/test_calldatacopy.py | 0 .../{ => unit}/compiler/ir/test_compile_ir.py | 0 .../compiler/ir/test_optimize_ir.py | 0 tests/{ => unit}/compiler/ir/test_repeat.py | 0 tests/{ => unit}/compiler/ir/test_with.py | 0 .../compiler/test_bytecode_runtime.py | 0 .../{ => unit}/compiler/test_compile_code.py | 0 .../compiler/test_default_settings.py | 0 .../{ => unit}/compiler/test_input_bundle.py | 0 tests/{ => unit}/compiler/test_opcodes.py | 0 tests/{ => unit}/compiler/test_pre_parser.py | 0 tests/{ => unit}/compiler/test_sha3_32.py | 0 tests/{ => unit}/compiler/test_source_map.py | 0 .../semantics/analysis/test_array_index.py | 0 .../analysis/test_cyclic_function_calls.py | 0 .../semantics/analysis/test_for_loop.py | 0 .../analysis/test_potential_types.py | 0 .../semantics/conftest.py | 0 .../semantics/test_namespace.py | 0 .../semantics}/test_storage_slots.py | 0 .../semantics/types/test_event.py | 0 .../semantics/types/test_pure_types.py | 0 .../semantics/types/test_size_in_bytes.py | 0 .../semantics/types/test_type_from_abi.py | 0 .../types/test_type_from_annotation.py | 0 274 files changed, 282 insertions(+), 284 deletions(-) delete mode 100644 tests/base_conftest.py rename tests/{compiler/ir => functional}/__init__.py (100%) rename tests/{parser/exceptions => functional/builtins/codegen}/__init__.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_abi.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_abi_decode.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_abi_encode.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_addmod.py (100%) rename tests/{parser/types/value => functional/builtins/codegen}/test_as_wei_value.py (75%) rename tests/{parser/functions => functional/builtins/codegen}/test_bitwise.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_ceil.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_concat.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_convert.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_create_functions.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_ec.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_ecrecover.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_empty.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_extract32.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_floor.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_interfaces.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_is_contract.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_keccak256.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_length.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_method_id.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_minmax.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_minmax_value.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_mulmod.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_raw_call.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_send.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_sha256.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_slice.py (100%) rename tests/{parser/functions/test_mkstr.py => functional/builtins/codegen/test_uint2str.py} (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_unary.py (100%) rename tests/{parser/functions => functional/builtins/codegen}/test_unsafe_math.py (100%) rename tests/{ => functional}/builtins/folding/test_abs.py (100%) rename tests/{ => functional}/builtins/folding/test_addmod_mulmod.py (100%) rename tests/{ => functional}/builtins/folding/test_bitwise.py (100%) rename tests/{ => functional}/builtins/folding/test_epsilon.py (100%) rename tests/{ => functional}/builtins/folding/test_floor_ceil.py (100%) rename tests/{ => functional}/builtins/folding/test_fold_as_wei_value.py (100%) rename tests/{ => functional}/builtins/folding/test_keccak_sha.py (100%) rename tests/{ => functional}/builtins/folding/test_len.py (100%) rename tests/{ => functional}/builtins/folding/test_min_max.py (100%) rename tests/{ => functional}/builtins/folding/test_powmod.py (100%) rename tests/{parser/functions => functional/codegen}/__init__.py (100%) rename tests/{parser/functions => functional/codegen/calling_convention}/test_default_function.py (100%) rename tests/{parser/functions => functional/codegen/calling_convention}/test_default_parameters.py (100%) rename tests/{parser/features/external_contracts => functional/codegen/calling_convention}/test_erc20_abi.py (100%) rename tests/{parser/features/external_contracts => functional/codegen/calling_convention}/test_external_contract_calls.py (100%) rename tests/{parser/features/external_contracts => functional/codegen/calling_convention}/test_modifiable_external_contract_calls.py (100%) rename tests/{parser/functions => functional/codegen/calling_convention}/test_return.py (100%) rename tests/{parser/functions => functional/codegen/calling_convention}/test_return_struct.py (100%) rename tests/{parser/functions => functional/codegen/calling_convention}/test_return_tuple.py (100%) rename tests/{parser/features/external_contracts => functional/codegen/calling_convention}/test_self_call_struct.py (100%) rename tests/functional/codegen/{ => calling_convention}/test_struct_return.py (100%) rename tests/functional/codegen/{ => calling_convention}/test_tuple_return.py (100%) rename tests/{parser/functions => functional/codegen/environment_variables}/test_block_number.py (100%) rename tests/{parser/functions/test_block.py => functional/codegen/environment_variables/test_blockhash.py} (100%) rename tests/{parser/functions => functional/codegen/environment_variables}/test_tx.py (100%) rename tests/{parser => functional/codegen}/features/decorators/test_nonreentrant.py (100%) rename tests/{parser => functional/codegen}/features/decorators/test_payable.py (100%) rename tests/{parser => functional/codegen}/features/decorators/test_private.py (100%) rename tests/{parser => functional/codegen}/features/decorators/test_public.py (100%) rename tests/{parser => functional/codegen}/features/decorators/test_pure.py (100%) rename tests/{parser => functional/codegen}/features/decorators/test_view.py (100%) rename tests/{parser => functional/codegen}/features/iteration/test_break.py (100%) rename tests/{parser => functional/codegen}/features/iteration/test_continue.py (100%) rename tests/{parser => functional/codegen}/features/iteration/test_for_in_list.py (100%) rename tests/{parser => functional/codegen}/features/iteration/test_for_range.py (100%) rename tests/{parser => functional/codegen}/features/iteration/test_range_in.py (100%) rename tests/{parser => functional/codegen}/features/test_address_balance.py (100%) rename tests/{parser => functional/codegen}/features/test_assert.py (100%) rename tests/{parser => functional/codegen}/features/test_assert_unreachable.py (100%) rename tests/{parser => functional/codegen}/features/test_assignment.py (100%) rename tests/{parser => functional/codegen}/features/test_bytes_map_keys.py (100%) rename tests/{parser => functional/codegen}/features/test_clampers.py (100%) rename tests/{parser => functional/codegen}/features/test_comments.py (100%) rename tests/{parser => functional/codegen}/features/test_comparison.py (100%) rename tests/{parser => functional/codegen}/features/test_conditionals.py (100%) rename tests/{parser => functional/codegen}/features/test_constructor.py (100%) rename tests/{parser => functional/codegen}/features/test_gas.py (100%) rename tests/{parser => functional/codegen}/features/test_immutable.py (100%) rename tests/{parser => functional/codegen}/features/test_init.py (100%) rename tests/{parser => functional/codegen}/features/test_internal_call.py (100%) rename tests/{parser => functional/codegen}/features/test_logging.py (100%) rename tests/{parser => functional/codegen}/features/test_logging_bytes_extended.py (100%) rename tests/{parser => functional/codegen}/features/test_logging_from_call.py (100%) rename tests/{parser => functional/codegen}/features/test_memory_alloc.py (100%) rename tests/{parser => functional/codegen}/features/test_memory_dealloc.py (100%) rename tests/{parser => functional/codegen}/features/test_packing.py (100%) rename tests/{parser => functional/codegen}/features/test_reverting.py (100%) rename tests/{parser => functional/codegen}/features/test_short_circuiting.py (100%) rename tests/{parser => functional/codegen}/features/test_string_map_keys.py (100%) rename tests/{parser => functional/codegen}/features/test_ternary.py (100%) rename tests/{parser => functional/codegen}/features/test_transient.py (100%) rename tests/{parser => functional/codegen}/integration/test_basics.py (100%) rename tests/{parser => functional/codegen}/integration/test_crowdfund.py (98%) rename tests/{parser => functional/codegen}/integration/test_escrow.py (100%) rename tests/{parser/globals => functional/codegen/storage_variables}/test_getters.py (100%) rename tests/{parser/globals => functional/codegen/storage_variables}/test_setters.py (100%) rename tests/{parser/globals/test_globals.py => functional/codegen/storage_variables/test_storage_variable.py} (100%) rename tests/{parser => functional/codegen}/test_call_graph_stability.py (100%) rename tests/{parser => functional/codegen}/test_selector_table.py (100%) rename tests/{parser => functional/codegen}/test_selector_table_stability.py (100%) rename tests/{parser => functional/codegen}/types/numbers/test_constants.py (100%) rename tests/{parser => functional/codegen}/types/numbers/test_decimals.py (100%) rename tests/{parser/features/arithmetic => functional/codegen/types/numbers}/test_division.py (100%) rename tests/{fuzzing => functional/codegen/types/numbers}/test_exponents.py (100%) rename tests/{parser => functional/codegen}/types/numbers/test_isqrt.py (100%) rename tests/{parser/features/arithmetic => functional/codegen/types/numbers}/test_modulo.py (100%) rename tests/{parser => functional/codegen}/types/numbers/test_signed_ints.py (100%) rename tests/{parser => functional/codegen}/types/numbers/test_sqrt.py (100%) rename tests/{parser => functional/codegen}/types/numbers/test_unsigned_ints.py (100%) rename tests/{parser => functional/codegen}/types/test_bytes.py (100%) rename tests/{parser => functional/codegen}/types/test_bytes_literal.py (100%) rename tests/{parser => functional/codegen}/types/test_bytes_zero_padding.py (100%) rename tests/{parser => functional/codegen}/types/test_dynamic_array.py (100%) rename tests/{parser => functional/codegen}/types/test_enum.py (100%) rename tests/{parser => functional/codegen}/types/test_identifier_naming.py (100%) mode change 100755 => 100644 rename tests/{parser => functional/codegen}/types/test_lists.py (100%) rename tests/{parser => functional/codegen}/types/test_node_types.py (100%) rename tests/{parser => functional/codegen}/types/test_string.py (100%) rename tests/{parser => functional/codegen}/types/test_string_literal.py (100%) rename tests/{ => functional}/examples/auctions/test_blind_auction.py (100%) rename tests/{ => functional}/examples/auctions/test_simple_open_auction.py (100%) rename tests/{ => functional}/examples/company/test_company.py (100%) rename tests/{ => functional}/examples/conftest.py (100%) rename tests/{ => functional}/examples/crowdfund/test_crowdfund_example.py (100%) rename tests/{ => functional}/examples/factory/test_factory.py (100%) rename tests/{ => functional}/examples/market_maker/test_on_chain_market_maker.py (100%) rename tests/{ => functional}/examples/name_registry/test_name_registry.py (100%) rename tests/{ => functional}/examples/safe_remote_purchase/test_safe_remote_purchase.py (100%) rename tests/{ => functional}/examples/storage/test_advanced_storage.py (100%) rename tests/{ => functional}/examples/storage/test_storage.py (100%) rename tests/{ => functional}/examples/tokens/test_erc1155.py (100%) rename tests/{ => functional}/examples/tokens/test_erc20.py (100%) rename tests/{ => functional}/examples/tokens/test_erc4626.py (100%) rename tests/{ => functional}/examples/tokens/test_erc721.py (100%) rename tests/{ => functional}/examples/voting/test_ballot.py (100%) rename tests/{ => functional}/examples/wallet/test_wallet.py (100%) rename tests/{ => functional}/grammar/test_grammar.py (100%) rename tests/{parser => functional}/syntax/__init__.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_argument_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_call_violation.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_constancy_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_function_declaration_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_instantiation_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_invalid_literal_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_invalid_payable.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_invalid_reference.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_invalid_type_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_namespace_collision.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_overflow_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_structure_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_syntax_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_type_mismatch_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_undeclared_definition.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_variable_declaration_exception.py (100%) rename tests/{parser => functional/syntax}/exceptions/test_vyper_exception_pos.py (100%) rename tests/{parser/syntax/utils => functional/syntax/names}/test_event_names.py (100%) rename tests/{parser/syntax/utils => functional/syntax/names}/test_function_names.py (100%) rename tests/{parser/syntax/utils => functional/syntax/names}/test_variable_names.py (100%) rename tests/{ => functional/syntax}/signatures/test_invalid_function_decorators.py (100%) rename tests/{ => functional/syntax}/signatures/test_method_id_conflicts.py (100%) rename tests/{parser => functional}/syntax/test_abi_decode.py (100%) rename tests/{parser => functional}/syntax/test_abi_encode.py (100%) rename tests/{parser => functional}/syntax/test_addmulmod.py (100%) rename tests/{parser => functional}/syntax/test_address_code.py (100%) rename tests/{parser => functional}/syntax/test_ann_assign.py (100%) rename tests/{parser => functional}/syntax/test_as_uint256.py (100%) rename tests/{parser => functional}/syntax/test_as_wei_value.py (100%) rename tests/{parser => functional}/syntax/test_block.py (100%) rename tests/{parser => functional}/syntax/test_blockscope.py (100%) rename tests/{parser => functional}/syntax/test_bool.py (100%) rename tests/{parser => functional}/syntax/test_bool_ops.py (100%) rename tests/{parser => functional}/syntax/test_bytes.py (100%) rename tests/{parser => functional}/syntax/test_chainid.py (100%) rename tests/{parser => functional}/syntax/test_code_size.py (100%) rename tests/{parser => functional}/syntax/test_codehash.py (100%) rename tests/{parser => functional}/syntax/test_concat.py (100%) rename tests/{parser => functional}/syntax/test_conditionals.py (100%) rename tests/{parser => functional}/syntax/test_constants.py (100%) rename tests/{parser => functional}/syntax/test_create_with_code_of.py (100%) rename tests/{parser => functional}/syntax/test_dynamic_array.py (100%) rename tests/{parser => functional}/syntax/test_enum.py (100%) rename tests/{parser => functional}/syntax/test_extract32.py (100%) rename tests/{parser => functional}/syntax/test_for_range.py (100%) rename tests/{parser => functional}/syntax/test_functions_call.py (100%) rename tests/{parser => functional}/syntax/test_immutables.py (100%) rename tests/{parser => functional}/syntax/test_interfaces.py (100%) rename tests/{parser => functional}/syntax/test_invalids.py (100%) rename tests/{parser => functional}/syntax/test_keccak256.py (100%) rename tests/{parser => functional}/syntax/test_len.py (100%) rename tests/{parser => functional}/syntax/test_list.py (100%) rename tests/{parser => functional}/syntax/test_logging.py (100%) rename tests/{parser => functional}/syntax/test_minmax.py (100%) rename tests/{parser => functional}/syntax/test_minmax_value.py (100%) rename tests/{parser => functional}/syntax/test_msg_data.py (100%) rename tests/{parser => functional}/syntax/test_nested_list.py (100%) rename tests/{parser => functional}/syntax/test_no_none.py (100%) rename tests/{parser => functional}/syntax/test_print.py (100%) rename tests/{parser => functional}/syntax/test_public.py (100%) rename tests/{parser => functional}/syntax/test_raw_call.py (100%) rename tests/{parser => functional}/syntax/test_return_tuple.py (100%) rename tests/{parser => functional}/syntax/test_self_balance.py (100%) rename tests/{parser => functional}/syntax/test_selfdestruct.py (100%) rename tests/{parser => functional}/syntax/test_send.py (100%) rename tests/{parser => functional}/syntax/test_slice.py (100%) rename tests/{parser => functional}/syntax/test_string.py (100%) rename tests/{parser => functional}/syntax/test_structs.py (100%) rename tests/{parser => functional}/syntax/test_ternary.py (100%) rename tests/{parser => functional}/syntax/test_tuple_assign.py (100%) rename tests/{parser => functional}/syntax/test_unbalanced_return.py (100%) delete mode 100644 tests/parser/functions/test_as_wei_value.py create mode 100644 tests/unit/__init__.py rename tests/{ => unit}/abi_types/test_invalid_abi_types.py (100%) rename tests/{ => unit}/ast/nodes/test_binary.py (100%) rename tests/{ => unit}/ast/nodes/test_compare_nodes.py (100%) rename tests/{ => unit}/ast/nodes/test_evaluate_binop_decimal.py (100%) rename tests/{ => unit}/ast/nodes/test_evaluate_binop_int.py (100%) rename tests/{ => unit}/ast/nodes/test_evaluate_boolop.py (100%) rename tests/{ => unit}/ast/nodes/test_evaluate_compare.py (100%) rename tests/{ => unit}/ast/nodes/test_evaluate_subscript.py (100%) rename tests/{ => unit}/ast/nodes/test_evaluate_unaryop.py (100%) rename tests/{ => unit}/ast/nodes/test_from_node.py (100%) rename tests/{ => unit}/ast/nodes/test_get_children.py (100%) rename tests/{ => unit}/ast/nodes/test_get_descendants.py (100%) rename tests/{ => unit}/ast/nodes/test_hex.py (100%) rename tests/{ => unit}/ast/nodes/test_replace_in_tree.py (100%) rename tests/{parser/parser_utils => unit/ast}/test_annotate_and_optimize_ast.py (100%) rename tests/{parser/ast_utils => unit/ast}/test_ast_dict.py (100%) rename tests/{ => unit}/ast/test_folding.py (100%) rename tests/{ => unit}/ast/test_metadata_journal.py (100%) rename tests/{ => unit}/ast/test_natspec.py (100%) rename tests/{parser/ast_utils/test_ast.py => unit/ast/test_parser.py} (100%) rename tests/{ => unit}/ast/test_pre_parser.py (100%) rename tests/{test_utils.py => unit/ast/test_source_annotation.py} (100%) rename tests/{ => unit}/cli/outputs/test_storage_layout.py (100%) rename tests/{ => unit}/cli/outputs/test_storage_layout_overrides.py (100%) rename tests/{ => unit}/cli/vyper_compile/test_compile_files.py (100%) rename tests/{ => unit}/cli/vyper_compile/test_parse_args.py (100%) rename tests/{ => unit}/cli/vyper_json/test_compile_json.py (100%) rename tests/{ => unit}/cli/vyper_json/test_get_inputs.py (100%) rename tests/{ => unit}/cli/vyper_json/test_get_settings.py (100%) rename tests/{ => unit}/cli/vyper_json/test_output_selection.py (100%) rename tests/{ => unit}/cli/vyper_json/test_parse_args_vyperjson.py (100%) rename tests/{ => unit}/compiler/__init__.py (100%) rename tests/{ => unit}/compiler/asm/test_asm_optimizer.py (100%) create mode 100644 tests/unit/compiler/ir/__init__.py rename tests/{compiler => unit/compiler/ir}/test_calldatacopy.py (100%) rename tests/{ => unit}/compiler/ir/test_compile_ir.py (100%) rename tests/{ => unit}/compiler/ir/test_optimize_ir.py (100%) rename tests/{ => unit}/compiler/ir/test_repeat.py (100%) rename tests/{ => unit}/compiler/ir/test_with.py (100%) rename tests/{ => unit}/compiler/test_bytecode_runtime.py (100%) rename tests/{ => unit}/compiler/test_compile_code.py (100%) rename tests/{ => unit}/compiler/test_default_settings.py (100%) rename tests/{ => unit}/compiler/test_input_bundle.py (100%) rename tests/{ => unit}/compiler/test_opcodes.py (100%) rename tests/{ => unit}/compiler/test_pre_parser.py (100%) rename tests/{ => unit}/compiler/test_sha3_32.py (100%) rename tests/{ => unit}/compiler/test_source_map.py (100%) rename tests/{functional => unit}/semantics/analysis/test_array_index.py (100%) rename tests/{functional => unit}/semantics/analysis/test_cyclic_function_calls.py (100%) rename tests/{functional => unit}/semantics/analysis/test_for_loop.py (100%) rename tests/{functional => unit}/semantics/analysis/test_potential_types.py (100%) rename tests/{functional => unit}/semantics/conftest.py (100%) rename tests/{functional => unit}/semantics/test_namespace.py (100%) rename tests/{functional => unit/semantics}/test_storage_slots.py (100%) rename tests/{functional => unit}/semantics/types/test_event.py (100%) rename tests/{functional => unit}/semantics/types/test_pure_types.py (100%) rename tests/{functional => unit}/semantics/types/test_size_in_bytes.py (100%) rename tests/{functional => unit}/semantics/types/test_type_from_abi.py (100%) rename tests/{functional => unit}/semantics/types/test_type_from_annotation.py (100%) diff --git a/tests/base_conftest.py b/tests/base_conftest.py deleted file mode 100644 index f613ad0f47..0000000000 --- a/tests/base_conftest.py +++ /dev/null @@ -1,217 +0,0 @@ -import json - -import pytest -import web3.exceptions -from eth_tester import EthereumTester, PyEVMBackend -from eth_tester.exceptions import TransactionFailed -from eth_utils.toolz import compose -from hexbytes import HexBytes -from web3 import Web3 -from web3.contract import Contract -from web3.providers.eth_tester import EthereumTesterProvider - -from vyper import compiler -from vyper.ast.grammar import parse_vyper_source -from vyper.compiler.settings import Settings - - -class VyperMethod: - ALLOWED_MODIFIERS = {"call", "estimateGas", "transact", "buildTransaction"} - - def __init__(self, function, normalizers=None): - self._function = function - self._function._return_data_normalizers = normalizers - - def __call__(self, *args, **kwargs): - return self.__prepared_function(*args, **kwargs) - - def __prepared_function(self, *args, **kwargs): - if not kwargs: - modifier, modifier_dict = "call", {} - fn_abi = [ - x - for x in self._function.contract_abi - if x.get("name") == self._function.function_identifier - ].pop() - # To make tests faster just supply some high gas value. - modifier_dict.update({"gas": fn_abi.get("gas", 0) + 500000}) - elif len(kwargs) == 1: - modifier, modifier_dict = kwargs.popitem() - if modifier not in self.ALLOWED_MODIFIERS: - raise TypeError(f"The only allowed keyword arguments are: {self.ALLOWED_MODIFIERS}") - else: - raise TypeError(f"Use up to one keyword argument, one of: {self.ALLOWED_MODIFIERS}") - return getattr(self._function(*args), modifier)(modifier_dict) - - -class VyperContract: - """ - An alternative Contract Factory which invokes all methods as `call()`, - unless you add a keyword argument. The keyword argument assigns the prep method. - This call - > contract.withdraw(amount, transact={'from': eth.accounts[1], 'gas': 100000, ...}) - is equivalent to this call in the classic contract: - > contract.functions.withdraw(amount).transact({'from': eth.accounts[1], 'gas': 100000, ...}) - """ - - def __init__(self, classic_contract, method_class=VyperMethod): - classic_contract._return_data_normalizers += CONCISE_NORMALIZERS - self._classic_contract = classic_contract - self.address = self._classic_contract.address - protected_fn_names = [fn for fn in dir(self) if not fn.endswith("__")] - - try: - fn_names = [fn["name"] for fn in self._classic_contract.functions._functions] - except web3.exceptions.NoABIFunctionsFound: - fn_names = [] - - for fn_name in fn_names: - # Override namespace collisions - if fn_name in protected_fn_names: - raise AttributeError(f"{fn_name} is protected!") - else: - _classic_method = getattr(self._classic_contract.functions, fn_name) - _concise_method = method_class( - _classic_method, self._classic_contract._return_data_normalizers - ) - setattr(self, fn_name, _concise_method) - - @classmethod - def factory(cls, *args, **kwargs): - return compose(cls, Contract.factory(*args, **kwargs)) - - -def _none_addr(datatype, data): - if datatype == "address" and int(data, base=16) == 0: - return (datatype, None) - else: - return (datatype, data) - - -CONCISE_NORMALIZERS = (_none_addr,) - - -@pytest.fixture(scope="module") -def tester(): - # set absurdly high gas limit so that london basefee never adjusts - # (note: 2**63 - 1 is max that evm allows) - custom_genesis = PyEVMBackend._generate_genesis_params(overrides={"gas_limit": 10**10}) - custom_genesis["base_fee_per_gas"] = 0 - backend = PyEVMBackend(genesis_parameters=custom_genesis) - return EthereumTester(backend=backend) - - -def zero_gas_price_strategy(web3, transaction_params=None): - return 0 # zero gas price makes testing simpler. - - -@pytest.fixture(scope="module") -def w3(tester): - w3 = Web3(EthereumTesterProvider(tester)) - w3.eth.set_gas_price_strategy(zero_gas_price_strategy) - return w3 - - -def _get_contract( - w3, source_code, optimize, *args, override_opt_level=None, input_bundle=None, **kwargs -): - settings = Settings() - settings.evm_version = kwargs.pop("evm_version", None) - settings.optimize = override_opt_level or optimize - out = compiler.compile_code( - source_code, - # test that metadata and natspecs get generated - output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"], - settings=settings, - input_bundle=input_bundle, - show_gas_estimates=True, # Enable gas estimates for testing - ) - parse_vyper_source(source_code) # Test grammar. - json.dumps(out["metadata"]) # test metadata is json serializable - abi = out["abi"] - bytecode = out["bytecode"] - value = kwargs.pop("value_in_eth", 0) * 10**18 # Handle deploying with an eth value. - c = w3.eth.contract(abi=abi, bytecode=bytecode) - deploy_transaction = c.constructor(*args) - tx_info = {"from": w3.eth.accounts[0], "value": value, "gasPrice": 0} - tx_info.update(kwargs) - tx_hash = deploy_transaction.transact(tx_info) - address = w3.eth.get_transaction_receipt(tx_hash)["contractAddress"] - return w3.eth.contract(address, abi=abi, bytecode=bytecode, ContractFactoryClass=VyperContract) - - -def _deploy_blueprint_for(w3, source_code, optimize, initcode_prefix=b"", **kwargs): - settings = Settings() - settings.evm_version = kwargs.pop("evm_version", None) - settings.optimize = optimize - out = compiler.compile_code( - source_code, - output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"], - settings=settings, - show_gas_estimates=True, # Enable gas estimates for testing - ) - parse_vyper_source(source_code) # Test grammar. - abi = out["abi"] - bytecode = HexBytes(initcode_prefix) + HexBytes(out["bytecode"]) - bytecode_len = len(bytecode) - bytecode_len_hex = hex(bytecode_len)[2:].rjust(4, "0") - # prepend a quick deploy preamble - deploy_preamble = HexBytes("61" + bytecode_len_hex + "3d81600a3d39f3") - deploy_bytecode = HexBytes(deploy_preamble) + bytecode - - deployer_abi = [] # just a constructor - c = w3.eth.contract(abi=deployer_abi, bytecode=deploy_bytecode) - deploy_transaction = c.constructor() - tx_info = {"from": w3.eth.accounts[0], "value": 0, "gasPrice": 0} - - tx_hash = deploy_transaction.transact(tx_info) - address = w3.eth.get_transaction_receipt(tx_hash)["contractAddress"] - - # sanity check - assert w3.eth.get_code(address) == bytecode, (w3.eth.get_code(address), bytecode) - - def factory(address): - return w3.eth.contract( - address, abi=abi, bytecode=bytecode, ContractFactoryClass=VyperContract - ) - - return w3.eth.contract(address, bytecode=deploy_bytecode), factory - - -@pytest.fixture(scope="module") -def deploy_blueprint_for(w3, optimize): - def deploy_blueprint_for(source_code, *args, **kwargs): - return _deploy_blueprint_for(w3, source_code, optimize, *args, **kwargs) - - return deploy_blueprint_for - - -@pytest.fixture(scope="module") -def get_contract(w3, optimize): - def fn(source_code, *args, **kwargs): - return _get_contract(w3, source_code, optimize, *args, **kwargs) - - return fn - - -@pytest.fixture -def get_logs(w3): - def get_logs(tx_hash, c, event_name): - tx_receipt = w3.eth.get_transaction_receipt(tx_hash) - return c._classic_contract.events[event_name]().process_receipt(tx_receipt) - - return get_logs - - -@pytest.fixture(scope="module") -def assert_tx_failed(tester): - def assert_tx_failed(function_to_test, exception=TransactionFailed, exc_text=None): - snapshot_id = tester.take_snapshot() - with pytest.raises(exception) as excinfo: - function_to_test() - tester.revert_to_snapshot(snapshot_id) - if exc_text: - # TODO test equality - assert exc_text in str(excinfo.value), (exc_text, excinfo.value) - - return assert_tx_failed diff --git a/tests/conftest.py b/tests/conftest.py index 9b10b7c51c..216fb32b0d 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,24 +1,28 @@ +import json import logging from functools import wraps import hypothesis import pytest +import web3.exceptions from eth_tester import EthereumTester, PyEVMBackend +from eth_tester.exceptions import TransactionFailed from eth_utils import setup_DEBUG2_logging +from eth_utils.toolz import compose from hexbytes import HexBytes from web3 import Web3 +from web3.contract import Contract from web3.providers.eth_tester import EthereumTesterProvider from vyper import compiler +from vyper.ast.grammar import parse_vyper_source from vyper.codegen.ir_node import IRnode from vyper.compiler.input_bundle import FilesystemInputBundle -from vyper.compiler.settings import OptimizationLevel, _set_debug_mode +from vyper.compiler.settings import OptimizationLevel, Settings, _set_debug_mode from vyper.ir import compile_ir, optimizer -from .base_conftest import VyperContract, _get_contract, zero_gas_price_strategy - -# Import the base_conftest fixtures -pytest_plugins = ["tests.base_conftest", "tests.fixtures.memorymock"] +# Import the base fixtures +pytest_plugins = ["tests.fixtures.memorymock"] ############ # PATCHING # @@ -99,6 +103,8 @@ def fn(sources_dict): return fn +# TODO: remove me, this is just string.encode("utf-8").ljust() +# only used in test_logging.py. @pytest.fixture def bytes_helper(): def bytes_helper(str, length): @@ -107,45 +113,35 @@ def bytes_helper(str, length): return bytes_helper -@pytest.fixture -def get_contract_from_ir(w3, optimize): - def ir_compiler(ir, *args, **kwargs): - ir = IRnode.from_list(ir) - if optimize != OptimizationLevel.NONE: - ir = optimizer.optimize(ir) - bytecode, _ = compile_ir.assembly_to_evm( - compile_ir.compile_to_assembly(ir, optimize=optimize) - ) - abi = kwargs.get("abi") or [] - c = w3.eth.contract(abi=abi, bytecode=bytecode) - deploy_transaction = c.constructor() - tx_hash = deploy_transaction.transact() - address = w3.eth.get_transaction_receipt(tx_hash)["contractAddress"] - contract = w3.eth.contract( - address, abi=abi, bytecode=bytecode, ContractFactoryClass=VyperContract - ) - return contract +def _none_addr(datatype, data): + if datatype == "address" and int(data, base=16) == 0: + return (datatype, None) + else: + return (datatype, data) - return ir_compiler + +CONCISE_NORMALIZERS = (_none_addr,) @pytest.fixture(scope="module") -def get_contract_module(optimize): - """ - This fixture is used for Hypothesis tests to ensure that - the same contract is called over multiple runs of the test. - """ - custom_genesis = PyEVMBackend._generate_genesis_params(overrides={"gas_limit": 4500000}) +def tester(): + # set absurdly high gas limit so that london basefee never adjusts + # (note: 2**63 - 1 is max that evm allows) + custom_genesis = PyEVMBackend._generate_genesis_params(overrides={"gas_limit": 10**10}) custom_genesis["base_fee_per_gas"] = 0 backend = PyEVMBackend(genesis_parameters=custom_genesis) - tester = EthereumTester(backend=backend) - w3 = Web3(EthereumTesterProvider(tester)) - w3.eth.set_gas_price_strategy(zero_gas_price_strategy) + return EthereumTester(backend=backend) - def get_contract_module(source_code, *args, **kwargs): - return _get_contract(w3, source_code, optimize, *args, **kwargs) - return get_contract_module +def zero_gas_price_strategy(web3, transaction_params=None): + return 0 # zero gas price makes testing simpler. + + +@pytest.fixture(scope="module") +def w3(tester): + w3 = Web3(EthereumTesterProvider(tester)) + w3.eth.set_gas_price_strategy(zero_gas_price_strategy) + return w3 def get_compiler_gas_estimate(code, func): @@ -187,6 +183,130 @@ def set_decorator_to_contract_function(w3, tester, contract, source_code, func): setattr(contract, func, func_with_decorator) +class VyperMethod: + ALLOWED_MODIFIERS = {"call", "estimateGas", "transact", "buildTransaction"} + + def __init__(self, function, normalizers=None): + self._function = function + self._function._return_data_normalizers = normalizers + + def __call__(self, *args, **kwargs): + return self.__prepared_function(*args, **kwargs) + + def __prepared_function(self, *args, **kwargs): + if not kwargs: + modifier, modifier_dict = "call", {} + fn_abi = [ + x + for x in self._function.contract_abi + if x.get("name") == self._function.function_identifier + ].pop() + # To make tests faster just supply some high gas value. + modifier_dict.update({"gas": fn_abi.get("gas", 0) + 500000}) + elif len(kwargs) == 1: + modifier, modifier_dict = kwargs.popitem() + if modifier not in self.ALLOWED_MODIFIERS: + raise TypeError(f"The only allowed keyword arguments are: {self.ALLOWED_MODIFIERS}") + else: + raise TypeError(f"Use up to one keyword argument, one of: {self.ALLOWED_MODIFIERS}") + return getattr(self._function(*args), modifier)(modifier_dict) + + +class VyperContract: + """ + An alternative Contract Factory which invokes all methods as `call()`, + unless you add a keyword argument. The keyword argument assigns the prep method. + This call + > contract.withdraw(amount, transact={'from': eth.accounts[1], 'gas': 100000, ...}) + is equivalent to this call in the classic contract: + > contract.functions.withdraw(amount).transact({'from': eth.accounts[1], 'gas': 100000, ...}) + """ + + def __init__(self, classic_contract, method_class=VyperMethod): + classic_contract._return_data_normalizers += CONCISE_NORMALIZERS + self._classic_contract = classic_contract + self.address = self._classic_contract.address + protected_fn_names = [fn for fn in dir(self) if not fn.endswith("__")] + + try: + fn_names = [fn["name"] for fn in self._classic_contract.functions._functions] + except web3.exceptions.NoABIFunctionsFound: + fn_names = [] + + for fn_name in fn_names: + # Override namespace collisions + if fn_name in protected_fn_names: + raise AttributeError(f"{fn_name} is protected!") + else: + _classic_method = getattr(self._classic_contract.functions, fn_name) + _concise_method = method_class( + _classic_method, self._classic_contract._return_data_normalizers + ) + setattr(self, fn_name, _concise_method) + + @classmethod + def factory(cls, *args, **kwargs): + return compose(cls, Contract.factory(*args, **kwargs)) + + +@pytest.fixture +def get_contract_from_ir(w3, optimize): + def ir_compiler(ir, *args, **kwargs): + ir = IRnode.from_list(ir) + if optimize != OptimizationLevel.NONE: + ir = optimizer.optimize(ir) + bytecode, _ = compile_ir.assembly_to_evm( + compile_ir.compile_to_assembly(ir, optimize=optimize) + ) + abi = kwargs.get("abi") or [] + c = w3.eth.contract(abi=abi, bytecode=bytecode) + deploy_transaction = c.constructor() + tx_hash = deploy_transaction.transact() + address = w3.eth.get_transaction_receipt(tx_hash)["contractAddress"] + contract = w3.eth.contract( + address, abi=abi, bytecode=bytecode, ContractFactoryClass=VyperContract + ) + return contract + + return ir_compiler + + +def _get_contract( + w3, source_code, optimize, *args, override_opt_level=None, input_bundle=None, **kwargs +): + settings = Settings() + settings.evm_version = kwargs.pop("evm_version", None) + settings.optimize = override_opt_level or optimize + out = compiler.compile_code( + source_code, + # test that metadata and natspecs get generated + output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"], + settings=settings, + input_bundle=input_bundle, + show_gas_estimates=True, # Enable gas estimates for testing + ) + parse_vyper_source(source_code) # Test grammar. + json.dumps(out["metadata"]) # test metadata is json serializable + abi = out["abi"] + bytecode = out["bytecode"] + value = kwargs.pop("value_in_eth", 0) * 10**18 # Handle deploying with an eth value. + c = w3.eth.contract(abi=abi, bytecode=bytecode) + deploy_transaction = c.constructor(*args) + tx_info = {"from": w3.eth.accounts[0], "value": value, "gasPrice": 0} + tx_info.update(kwargs) + tx_hash = deploy_transaction.transact(tx_info) + address = w3.eth.get_transaction_receipt(tx_hash)["contractAddress"] + return w3.eth.contract(address, abi=abi, bytecode=bytecode, ContractFactoryClass=VyperContract) + + +@pytest.fixture(scope="module") +def get_contract(w3, optimize): + def fn(source_code, *args, **kwargs): + return _get_contract(w3, source_code, optimize, *args, **kwargs) + + return fn + + @pytest.fixture def get_contract_with_gas_estimation(tester, w3, optimize): def get_contract_with_gas_estimation(source_code, *args, **kwargs): @@ -207,6 +327,73 @@ def get_contract_with_gas_estimation_for_constants(source_code, *args, **kwargs) return get_contract_with_gas_estimation_for_constants +@pytest.fixture(scope="module") +def get_contract_module(optimize): + """ + This fixture is used for Hypothesis tests to ensure that + the same contract is called over multiple runs of the test. + """ + custom_genesis = PyEVMBackend._generate_genesis_params(overrides={"gas_limit": 4500000}) + custom_genesis["base_fee_per_gas"] = 0 + backend = PyEVMBackend(genesis_parameters=custom_genesis) + tester = EthereumTester(backend=backend) + w3 = Web3(EthereumTesterProvider(tester)) + w3.eth.set_gas_price_strategy(zero_gas_price_strategy) + + def get_contract_module(source_code, *args, **kwargs): + return _get_contract(w3, source_code, optimize, *args, **kwargs) + + return get_contract_module + + +def _deploy_blueprint_for(w3, source_code, optimize, initcode_prefix=b"", **kwargs): + settings = Settings() + settings.evm_version = kwargs.pop("evm_version", None) + settings.optimize = optimize + out = compiler.compile_code( + source_code, + output_formats=["abi", "bytecode", "metadata", "userdoc", "devdoc"], + settings=settings, + show_gas_estimates=True, # Enable gas estimates for testing + ) + parse_vyper_source(source_code) # Test grammar. + abi = out["abi"] + bytecode = HexBytes(initcode_prefix) + HexBytes(out["bytecode"]) + bytecode_len = len(bytecode) + bytecode_len_hex = hex(bytecode_len)[2:].rjust(4, "0") + # prepend a quick deploy preamble + deploy_preamble = HexBytes("61" + bytecode_len_hex + "3d81600a3d39f3") + deploy_bytecode = HexBytes(deploy_preamble) + bytecode + + deployer_abi = [] # just a constructor + c = w3.eth.contract(abi=deployer_abi, bytecode=deploy_bytecode) + deploy_transaction = c.constructor() + tx_info = {"from": w3.eth.accounts[0], "value": 0, "gasPrice": 0} + + tx_hash = deploy_transaction.transact(tx_info) + address = w3.eth.get_transaction_receipt(tx_hash)["contractAddress"] + + # sanity check + assert w3.eth.get_code(address) == bytecode, (w3.eth.get_code(address), bytecode) + + def factory(address): + return w3.eth.contract( + address, abi=abi, bytecode=bytecode, ContractFactoryClass=VyperContract + ) + + return w3.eth.contract(address, bytecode=deploy_bytecode), factory + + +@pytest.fixture(scope="module") +def deploy_blueprint_for(w3, optimize): + def deploy_blueprint_for(source_code, *args, **kwargs): + return _deploy_blueprint_for(w3, source_code, optimize, *args, **kwargs) + + return deploy_blueprint_for + + +# TODO: this should not be a fixture. +# remove me and replace all uses with `with pytest.raises`. @pytest.fixture def assert_compile_failed(): def assert_compile_failed(function_to_test, exception=Exception): @@ -216,6 +403,7 @@ def assert_compile_failed(function_to_test, exception=Exception): return assert_compile_failed +# TODO this should not be a fixture @pytest.fixture def search_for_sublist(): def search_for_sublist(ir, sublist): @@ -277,3 +465,27 @@ def assert_side_effects_invoked(side_effects_contract, side_effects_trigger, n=1 assert end_value == start_value + n return assert_side_effects_invoked + + +@pytest.fixture +def get_logs(w3): + def get_logs(tx_hash, c, event_name): + tx_receipt = w3.eth.get_transaction_receipt(tx_hash) + return c._classic_contract.events[event_name]().process_receipt(tx_receipt) + + return get_logs + + +# TODO replace me with function like `with anchor_state()` +@pytest.fixture(scope="module") +def assert_tx_failed(tester): + def assert_tx_failed(function_to_test, exception=TransactionFailed, exc_text=None): + snapshot_id = tester.take_snapshot() + with pytest.raises(exception) as excinfo: + function_to_test() + tester.revert_to_snapshot(snapshot_id) + if exc_text: + # TODO test equality + assert exc_text in str(excinfo.value), (exc_text, excinfo.value) + + return assert_tx_failed diff --git a/tests/compiler/ir/__init__.py b/tests/functional/__init__.py similarity index 100% rename from tests/compiler/ir/__init__.py rename to tests/functional/__init__.py diff --git a/tests/parser/exceptions/__init__.py b/tests/functional/builtins/codegen/__init__.py similarity index 100% rename from tests/parser/exceptions/__init__.py rename to tests/functional/builtins/codegen/__init__.py diff --git a/tests/parser/functions/test_abi.py b/tests/functional/builtins/codegen/test_abi.py similarity index 100% rename from tests/parser/functions/test_abi.py rename to tests/functional/builtins/codegen/test_abi.py diff --git a/tests/parser/functions/test_abi_decode.py b/tests/functional/builtins/codegen/test_abi_decode.py similarity index 100% rename from tests/parser/functions/test_abi_decode.py rename to tests/functional/builtins/codegen/test_abi_decode.py diff --git a/tests/parser/functions/test_abi_encode.py b/tests/functional/builtins/codegen/test_abi_encode.py similarity index 100% rename from tests/parser/functions/test_abi_encode.py rename to tests/functional/builtins/codegen/test_abi_encode.py diff --git a/tests/parser/functions/test_addmod.py b/tests/functional/builtins/codegen/test_addmod.py similarity index 100% rename from tests/parser/functions/test_addmod.py rename to tests/functional/builtins/codegen/test_addmod.py diff --git a/tests/parser/types/value/test_as_wei_value.py b/tests/functional/builtins/codegen/test_as_wei_value.py similarity index 75% rename from tests/parser/types/value/test_as_wei_value.py rename to tests/functional/builtins/codegen/test_as_wei_value.py index 249ac4b2ff..cc27507e7c 100644 --- a/tests/parser/types/value/test_as_wei_value.py +++ b/tests/functional/builtins/codegen/test_as_wei_value.py @@ -91,3 +91,36 @@ def foo(a: {data_type}) -> uint256: c = get_contract(code) assert c.foo(0) == 0 + + +def test_ext_call(w3, side_effects_contract, assert_side_effects_invoked, get_contract): + code = """ +@external +def foo(a: Foo) -> uint256: + return as_wei_value(a.foo(7), "ether") + +interface Foo: + def foo(x: uint8) -> uint8: nonpayable + """ + + c1 = side_effects_contract("uint8") + c2 = get_contract(code) + + assert c2.foo(c1.address) == w3.to_wei(7, "ether") + assert_side_effects_invoked(c1, lambda: c2.foo(c1.address, transact={})) + + +def test_internal_call(w3, get_contract_with_gas_estimation): + code = """ +@external +def foo() -> uint256: + return as_wei_value(self.bar(), "ether") + +@internal +def bar() -> uint8: + return 7 + """ + + c = get_contract_with_gas_estimation(code) + + assert c.foo() == w3.to_wei(7, "ether") diff --git a/tests/parser/functions/test_bitwise.py b/tests/functional/builtins/codegen/test_bitwise.py similarity index 100% rename from tests/parser/functions/test_bitwise.py rename to tests/functional/builtins/codegen/test_bitwise.py diff --git a/tests/parser/functions/test_ceil.py b/tests/functional/builtins/codegen/test_ceil.py similarity index 100% rename from tests/parser/functions/test_ceil.py rename to tests/functional/builtins/codegen/test_ceil.py diff --git a/tests/parser/functions/test_concat.py b/tests/functional/builtins/codegen/test_concat.py similarity index 100% rename from tests/parser/functions/test_concat.py rename to tests/functional/builtins/codegen/test_concat.py diff --git a/tests/parser/functions/test_convert.py b/tests/functional/builtins/codegen/test_convert.py similarity index 100% rename from tests/parser/functions/test_convert.py rename to tests/functional/builtins/codegen/test_convert.py diff --git a/tests/parser/functions/test_create_functions.py b/tests/functional/builtins/codegen/test_create_functions.py similarity index 100% rename from tests/parser/functions/test_create_functions.py rename to tests/functional/builtins/codegen/test_create_functions.py diff --git a/tests/parser/functions/test_ec.py b/tests/functional/builtins/codegen/test_ec.py similarity index 100% rename from tests/parser/functions/test_ec.py rename to tests/functional/builtins/codegen/test_ec.py diff --git a/tests/parser/functions/test_ecrecover.py b/tests/functional/builtins/codegen/test_ecrecover.py similarity index 100% rename from tests/parser/functions/test_ecrecover.py rename to tests/functional/builtins/codegen/test_ecrecover.py diff --git a/tests/parser/functions/test_empty.py b/tests/functional/builtins/codegen/test_empty.py similarity index 100% rename from tests/parser/functions/test_empty.py rename to tests/functional/builtins/codegen/test_empty.py diff --git a/tests/parser/functions/test_extract32.py b/tests/functional/builtins/codegen/test_extract32.py similarity index 100% rename from tests/parser/functions/test_extract32.py rename to tests/functional/builtins/codegen/test_extract32.py diff --git a/tests/parser/functions/test_floor.py b/tests/functional/builtins/codegen/test_floor.py similarity index 100% rename from tests/parser/functions/test_floor.py rename to tests/functional/builtins/codegen/test_floor.py diff --git a/tests/parser/functions/test_interfaces.py b/tests/functional/builtins/codegen/test_interfaces.py similarity index 100% rename from tests/parser/functions/test_interfaces.py rename to tests/functional/builtins/codegen/test_interfaces.py diff --git a/tests/parser/functions/test_is_contract.py b/tests/functional/builtins/codegen/test_is_contract.py similarity index 100% rename from tests/parser/functions/test_is_contract.py rename to tests/functional/builtins/codegen/test_is_contract.py diff --git a/tests/parser/functions/test_keccak256.py b/tests/functional/builtins/codegen/test_keccak256.py similarity index 100% rename from tests/parser/functions/test_keccak256.py rename to tests/functional/builtins/codegen/test_keccak256.py diff --git a/tests/parser/functions/test_length.py b/tests/functional/builtins/codegen/test_length.py similarity index 100% rename from tests/parser/functions/test_length.py rename to tests/functional/builtins/codegen/test_length.py diff --git a/tests/parser/functions/test_method_id.py b/tests/functional/builtins/codegen/test_method_id.py similarity index 100% rename from tests/parser/functions/test_method_id.py rename to tests/functional/builtins/codegen/test_method_id.py diff --git a/tests/parser/functions/test_minmax.py b/tests/functional/builtins/codegen/test_minmax.py similarity index 100% rename from tests/parser/functions/test_minmax.py rename to tests/functional/builtins/codegen/test_minmax.py diff --git a/tests/parser/functions/test_minmax_value.py b/tests/functional/builtins/codegen/test_minmax_value.py similarity index 100% rename from tests/parser/functions/test_minmax_value.py rename to tests/functional/builtins/codegen/test_minmax_value.py diff --git a/tests/parser/functions/test_mulmod.py b/tests/functional/builtins/codegen/test_mulmod.py similarity index 100% rename from tests/parser/functions/test_mulmod.py rename to tests/functional/builtins/codegen/test_mulmod.py diff --git a/tests/parser/functions/test_raw_call.py b/tests/functional/builtins/codegen/test_raw_call.py similarity index 100% rename from tests/parser/functions/test_raw_call.py rename to tests/functional/builtins/codegen/test_raw_call.py diff --git a/tests/parser/functions/test_send.py b/tests/functional/builtins/codegen/test_send.py similarity index 100% rename from tests/parser/functions/test_send.py rename to tests/functional/builtins/codegen/test_send.py diff --git a/tests/parser/functions/test_sha256.py b/tests/functional/builtins/codegen/test_sha256.py similarity index 100% rename from tests/parser/functions/test_sha256.py rename to tests/functional/builtins/codegen/test_sha256.py diff --git a/tests/parser/functions/test_slice.py b/tests/functional/builtins/codegen/test_slice.py similarity index 100% rename from tests/parser/functions/test_slice.py rename to tests/functional/builtins/codegen/test_slice.py diff --git a/tests/parser/functions/test_mkstr.py b/tests/functional/builtins/codegen/test_uint2str.py similarity index 100% rename from tests/parser/functions/test_mkstr.py rename to tests/functional/builtins/codegen/test_uint2str.py diff --git a/tests/parser/functions/test_unary.py b/tests/functional/builtins/codegen/test_unary.py similarity index 100% rename from tests/parser/functions/test_unary.py rename to tests/functional/builtins/codegen/test_unary.py diff --git a/tests/parser/functions/test_unsafe_math.py b/tests/functional/builtins/codegen/test_unsafe_math.py similarity index 100% rename from tests/parser/functions/test_unsafe_math.py rename to tests/functional/builtins/codegen/test_unsafe_math.py diff --git a/tests/builtins/folding/test_abs.py b/tests/functional/builtins/folding/test_abs.py similarity index 100% rename from tests/builtins/folding/test_abs.py rename to tests/functional/builtins/folding/test_abs.py diff --git a/tests/builtins/folding/test_addmod_mulmod.py b/tests/functional/builtins/folding/test_addmod_mulmod.py similarity index 100% rename from tests/builtins/folding/test_addmod_mulmod.py rename to tests/functional/builtins/folding/test_addmod_mulmod.py diff --git a/tests/builtins/folding/test_bitwise.py b/tests/functional/builtins/folding/test_bitwise.py similarity index 100% rename from tests/builtins/folding/test_bitwise.py rename to tests/functional/builtins/folding/test_bitwise.py diff --git a/tests/builtins/folding/test_epsilon.py b/tests/functional/builtins/folding/test_epsilon.py similarity index 100% rename from tests/builtins/folding/test_epsilon.py rename to tests/functional/builtins/folding/test_epsilon.py diff --git a/tests/builtins/folding/test_floor_ceil.py b/tests/functional/builtins/folding/test_floor_ceil.py similarity index 100% rename from tests/builtins/folding/test_floor_ceil.py rename to tests/functional/builtins/folding/test_floor_ceil.py diff --git a/tests/builtins/folding/test_fold_as_wei_value.py b/tests/functional/builtins/folding/test_fold_as_wei_value.py similarity index 100% rename from tests/builtins/folding/test_fold_as_wei_value.py rename to tests/functional/builtins/folding/test_fold_as_wei_value.py diff --git a/tests/builtins/folding/test_keccak_sha.py b/tests/functional/builtins/folding/test_keccak_sha.py similarity index 100% rename from tests/builtins/folding/test_keccak_sha.py rename to tests/functional/builtins/folding/test_keccak_sha.py diff --git a/tests/builtins/folding/test_len.py b/tests/functional/builtins/folding/test_len.py similarity index 100% rename from tests/builtins/folding/test_len.py rename to tests/functional/builtins/folding/test_len.py diff --git a/tests/builtins/folding/test_min_max.py b/tests/functional/builtins/folding/test_min_max.py similarity index 100% rename from tests/builtins/folding/test_min_max.py rename to tests/functional/builtins/folding/test_min_max.py diff --git a/tests/builtins/folding/test_powmod.py b/tests/functional/builtins/folding/test_powmod.py similarity index 100% rename from tests/builtins/folding/test_powmod.py rename to tests/functional/builtins/folding/test_powmod.py diff --git a/tests/parser/functions/__init__.py b/tests/functional/codegen/__init__.py similarity index 100% rename from tests/parser/functions/__init__.py rename to tests/functional/codegen/__init__.py diff --git a/tests/parser/functions/test_default_function.py b/tests/functional/codegen/calling_convention/test_default_function.py similarity index 100% rename from tests/parser/functions/test_default_function.py rename to tests/functional/codegen/calling_convention/test_default_function.py diff --git a/tests/parser/functions/test_default_parameters.py b/tests/functional/codegen/calling_convention/test_default_parameters.py similarity index 100% rename from tests/parser/functions/test_default_parameters.py rename to tests/functional/codegen/calling_convention/test_default_parameters.py diff --git a/tests/parser/features/external_contracts/test_erc20_abi.py b/tests/functional/codegen/calling_convention/test_erc20_abi.py similarity index 100% rename from tests/parser/features/external_contracts/test_erc20_abi.py rename to tests/functional/codegen/calling_convention/test_erc20_abi.py diff --git a/tests/parser/features/external_contracts/test_external_contract_calls.py b/tests/functional/codegen/calling_convention/test_external_contract_calls.py similarity index 100% rename from tests/parser/features/external_contracts/test_external_contract_calls.py rename to tests/functional/codegen/calling_convention/test_external_contract_calls.py diff --git a/tests/parser/features/external_contracts/test_modifiable_external_contract_calls.py b/tests/functional/codegen/calling_convention/test_modifiable_external_contract_calls.py similarity index 100% rename from tests/parser/features/external_contracts/test_modifiable_external_contract_calls.py rename to tests/functional/codegen/calling_convention/test_modifiable_external_contract_calls.py diff --git a/tests/parser/functions/test_return.py b/tests/functional/codegen/calling_convention/test_return.py similarity index 100% rename from tests/parser/functions/test_return.py rename to tests/functional/codegen/calling_convention/test_return.py diff --git a/tests/parser/functions/test_return_struct.py b/tests/functional/codegen/calling_convention/test_return_struct.py similarity index 100% rename from tests/parser/functions/test_return_struct.py rename to tests/functional/codegen/calling_convention/test_return_struct.py diff --git a/tests/parser/functions/test_return_tuple.py b/tests/functional/codegen/calling_convention/test_return_tuple.py similarity index 100% rename from tests/parser/functions/test_return_tuple.py rename to tests/functional/codegen/calling_convention/test_return_tuple.py diff --git a/tests/parser/features/external_contracts/test_self_call_struct.py b/tests/functional/codegen/calling_convention/test_self_call_struct.py similarity index 100% rename from tests/parser/features/external_contracts/test_self_call_struct.py rename to tests/functional/codegen/calling_convention/test_self_call_struct.py diff --git a/tests/functional/codegen/test_struct_return.py b/tests/functional/codegen/calling_convention/test_struct_return.py similarity index 100% rename from tests/functional/codegen/test_struct_return.py rename to tests/functional/codegen/calling_convention/test_struct_return.py diff --git a/tests/functional/codegen/test_tuple_return.py b/tests/functional/codegen/calling_convention/test_tuple_return.py similarity index 100% rename from tests/functional/codegen/test_tuple_return.py rename to tests/functional/codegen/calling_convention/test_tuple_return.py diff --git a/tests/parser/functions/test_block_number.py b/tests/functional/codegen/environment_variables/test_block_number.py similarity index 100% rename from tests/parser/functions/test_block_number.py rename to tests/functional/codegen/environment_variables/test_block_number.py diff --git a/tests/parser/functions/test_block.py b/tests/functional/codegen/environment_variables/test_blockhash.py similarity index 100% rename from tests/parser/functions/test_block.py rename to tests/functional/codegen/environment_variables/test_blockhash.py diff --git a/tests/parser/functions/test_tx.py b/tests/functional/codegen/environment_variables/test_tx.py similarity index 100% rename from tests/parser/functions/test_tx.py rename to tests/functional/codegen/environment_variables/test_tx.py diff --git a/tests/parser/features/decorators/test_nonreentrant.py b/tests/functional/codegen/features/decorators/test_nonreentrant.py similarity index 100% rename from tests/parser/features/decorators/test_nonreentrant.py rename to tests/functional/codegen/features/decorators/test_nonreentrant.py diff --git a/tests/parser/features/decorators/test_payable.py b/tests/functional/codegen/features/decorators/test_payable.py similarity index 100% rename from tests/parser/features/decorators/test_payable.py rename to tests/functional/codegen/features/decorators/test_payable.py diff --git a/tests/parser/features/decorators/test_private.py b/tests/functional/codegen/features/decorators/test_private.py similarity index 100% rename from tests/parser/features/decorators/test_private.py rename to tests/functional/codegen/features/decorators/test_private.py diff --git a/tests/parser/features/decorators/test_public.py b/tests/functional/codegen/features/decorators/test_public.py similarity index 100% rename from tests/parser/features/decorators/test_public.py rename to tests/functional/codegen/features/decorators/test_public.py diff --git a/tests/parser/features/decorators/test_pure.py b/tests/functional/codegen/features/decorators/test_pure.py similarity index 100% rename from tests/parser/features/decorators/test_pure.py rename to tests/functional/codegen/features/decorators/test_pure.py diff --git a/tests/parser/features/decorators/test_view.py b/tests/functional/codegen/features/decorators/test_view.py similarity index 100% rename from tests/parser/features/decorators/test_view.py rename to tests/functional/codegen/features/decorators/test_view.py diff --git a/tests/parser/features/iteration/test_break.py b/tests/functional/codegen/features/iteration/test_break.py similarity index 100% rename from tests/parser/features/iteration/test_break.py rename to tests/functional/codegen/features/iteration/test_break.py diff --git a/tests/parser/features/iteration/test_continue.py b/tests/functional/codegen/features/iteration/test_continue.py similarity index 100% rename from tests/parser/features/iteration/test_continue.py rename to tests/functional/codegen/features/iteration/test_continue.py diff --git a/tests/parser/features/iteration/test_for_in_list.py b/tests/functional/codegen/features/iteration/test_for_in_list.py similarity index 100% rename from tests/parser/features/iteration/test_for_in_list.py rename to tests/functional/codegen/features/iteration/test_for_in_list.py diff --git a/tests/parser/features/iteration/test_for_range.py b/tests/functional/codegen/features/iteration/test_for_range.py similarity index 100% rename from tests/parser/features/iteration/test_for_range.py rename to tests/functional/codegen/features/iteration/test_for_range.py diff --git a/tests/parser/features/iteration/test_range_in.py b/tests/functional/codegen/features/iteration/test_range_in.py similarity index 100% rename from tests/parser/features/iteration/test_range_in.py rename to tests/functional/codegen/features/iteration/test_range_in.py diff --git a/tests/parser/features/test_address_balance.py b/tests/functional/codegen/features/test_address_balance.py similarity index 100% rename from tests/parser/features/test_address_balance.py rename to tests/functional/codegen/features/test_address_balance.py diff --git a/tests/parser/features/test_assert.py b/tests/functional/codegen/features/test_assert.py similarity index 100% rename from tests/parser/features/test_assert.py rename to tests/functional/codegen/features/test_assert.py diff --git a/tests/parser/features/test_assert_unreachable.py b/tests/functional/codegen/features/test_assert_unreachable.py similarity index 100% rename from tests/parser/features/test_assert_unreachable.py rename to tests/functional/codegen/features/test_assert_unreachable.py diff --git a/tests/parser/features/test_assignment.py b/tests/functional/codegen/features/test_assignment.py similarity index 100% rename from tests/parser/features/test_assignment.py rename to tests/functional/codegen/features/test_assignment.py diff --git a/tests/parser/features/test_bytes_map_keys.py b/tests/functional/codegen/features/test_bytes_map_keys.py similarity index 100% rename from tests/parser/features/test_bytes_map_keys.py rename to tests/functional/codegen/features/test_bytes_map_keys.py diff --git a/tests/parser/features/test_clampers.py b/tests/functional/codegen/features/test_clampers.py similarity index 100% rename from tests/parser/features/test_clampers.py rename to tests/functional/codegen/features/test_clampers.py diff --git a/tests/parser/features/test_comments.py b/tests/functional/codegen/features/test_comments.py similarity index 100% rename from tests/parser/features/test_comments.py rename to tests/functional/codegen/features/test_comments.py diff --git a/tests/parser/features/test_comparison.py b/tests/functional/codegen/features/test_comparison.py similarity index 100% rename from tests/parser/features/test_comparison.py rename to tests/functional/codegen/features/test_comparison.py diff --git a/tests/parser/features/test_conditionals.py b/tests/functional/codegen/features/test_conditionals.py similarity index 100% rename from tests/parser/features/test_conditionals.py rename to tests/functional/codegen/features/test_conditionals.py diff --git a/tests/parser/features/test_constructor.py b/tests/functional/codegen/features/test_constructor.py similarity index 100% rename from tests/parser/features/test_constructor.py rename to tests/functional/codegen/features/test_constructor.py diff --git a/tests/parser/features/test_gas.py b/tests/functional/codegen/features/test_gas.py similarity index 100% rename from tests/parser/features/test_gas.py rename to tests/functional/codegen/features/test_gas.py diff --git a/tests/parser/features/test_immutable.py b/tests/functional/codegen/features/test_immutable.py similarity index 100% rename from tests/parser/features/test_immutable.py rename to tests/functional/codegen/features/test_immutable.py diff --git a/tests/parser/features/test_init.py b/tests/functional/codegen/features/test_init.py similarity index 100% rename from tests/parser/features/test_init.py rename to tests/functional/codegen/features/test_init.py diff --git a/tests/parser/features/test_internal_call.py b/tests/functional/codegen/features/test_internal_call.py similarity index 100% rename from tests/parser/features/test_internal_call.py rename to tests/functional/codegen/features/test_internal_call.py diff --git a/tests/parser/features/test_logging.py b/tests/functional/codegen/features/test_logging.py similarity index 100% rename from tests/parser/features/test_logging.py rename to tests/functional/codegen/features/test_logging.py diff --git a/tests/parser/features/test_logging_bytes_extended.py b/tests/functional/codegen/features/test_logging_bytes_extended.py similarity index 100% rename from tests/parser/features/test_logging_bytes_extended.py rename to tests/functional/codegen/features/test_logging_bytes_extended.py diff --git a/tests/parser/features/test_logging_from_call.py b/tests/functional/codegen/features/test_logging_from_call.py similarity index 100% rename from tests/parser/features/test_logging_from_call.py rename to tests/functional/codegen/features/test_logging_from_call.py diff --git a/tests/parser/features/test_memory_alloc.py b/tests/functional/codegen/features/test_memory_alloc.py similarity index 100% rename from tests/parser/features/test_memory_alloc.py rename to tests/functional/codegen/features/test_memory_alloc.py diff --git a/tests/parser/features/test_memory_dealloc.py b/tests/functional/codegen/features/test_memory_dealloc.py similarity index 100% rename from tests/parser/features/test_memory_dealloc.py rename to tests/functional/codegen/features/test_memory_dealloc.py diff --git a/tests/parser/features/test_packing.py b/tests/functional/codegen/features/test_packing.py similarity index 100% rename from tests/parser/features/test_packing.py rename to tests/functional/codegen/features/test_packing.py diff --git a/tests/parser/features/test_reverting.py b/tests/functional/codegen/features/test_reverting.py similarity index 100% rename from tests/parser/features/test_reverting.py rename to tests/functional/codegen/features/test_reverting.py diff --git a/tests/parser/features/test_short_circuiting.py b/tests/functional/codegen/features/test_short_circuiting.py similarity index 100% rename from tests/parser/features/test_short_circuiting.py rename to tests/functional/codegen/features/test_short_circuiting.py diff --git a/tests/parser/features/test_string_map_keys.py b/tests/functional/codegen/features/test_string_map_keys.py similarity index 100% rename from tests/parser/features/test_string_map_keys.py rename to tests/functional/codegen/features/test_string_map_keys.py diff --git a/tests/parser/features/test_ternary.py b/tests/functional/codegen/features/test_ternary.py similarity index 100% rename from tests/parser/features/test_ternary.py rename to tests/functional/codegen/features/test_ternary.py diff --git a/tests/parser/features/test_transient.py b/tests/functional/codegen/features/test_transient.py similarity index 100% rename from tests/parser/features/test_transient.py rename to tests/functional/codegen/features/test_transient.py diff --git a/tests/parser/integration/test_basics.py b/tests/functional/codegen/integration/test_basics.py similarity index 100% rename from tests/parser/integration/test_basics.py rename to tests/functional/codegen/integration/test_basics.py diff --git a/tests/parser/integration/test_crowdfund.py b/tests/functional/codegen/integration/test_crowdfund.py similarity index 98% rename from tests/parser/integration/test_crowdfund.py rename to tests/functional/codegen/integration/test_crowdfund.py index c45a60d9c7..47c63dc015 100644 --- a/tests/parser/integration/test_crowdfund.py +++ b/tests/functional/codegen/integration/test_crowdfund.py @@ -1,3 +1,4 @@ +# TODO: check, this is probably redundant with examples/test_crowdfund.py def test_crowdfund(w3, tester, get_contract_with_gas_estimation_for_constants): crowdfund = """ diff --git a/tests/parser/integration/test_escrow.py b/tests/functional/codegen/integration/test_escrow.py similarity index 100% rename from tests/parser/integration/test_escrow.py rename to tests/functional/codegen/integration/test_escrow.py diff --git a/tests/parser/globals/test_getters.py b/tests/functional/codegen/storage_variables/test_getters.py similarity index 100% rename from tests/parser/globals/test_getters.py rename to tests/functional/codegen/storage_variables/test_getters.py diff --git a/tests/parser/globals/test_setters.py b/tests/functional/codegen/storage_variables/test_setters.py similarity index 100% rename from tests/parser/globals/test_setters.py rename to tests/functional/codegen/storage_variables/test_setters.py diff --git a/tests/parser/globals/test_globals.py b/tests/functional/codegen/storage_variables/test_storage_variable.py similarity index 100% rename from tests/parser/globals/test_globals.py rename to tests/functional/codegen/storage_variables/test_storage_variable.py diff --git a/tests/parser/test_call_graph_stability.py b/tests/functional/codegen/test_call_graph_stability.py similarity index 100% rename from tests/parser/test_call_graph_stability.py rename to tests/functional/codegen/test_call_graph_stability.py diff --git a/tests/parser/test_selector_table.py b/tests/functional/codegen/test_selector_table.py similarity index 100% rename from tests/parser/test_selector_table.py rename to tests/functional/codegen/test_selector_table.py diff --git a/tests/parser/test_selector_table_stability.py b/tests/functional/codegen/test_selector_table_stability.py similarity index 100% rename from tests/parser/test_selector_table_stability.py rename to tests/functional/codegen/test_selector_table_stability.py diff --git a/tests/parser/types/numbers/test_constants.py b/tests/functional/codegen/types/numbers/test_constants.py similarity index 100% rename from tests/parser/types/numbers/test_constants.py rename to tests/functional/codegen/types/numbers/test_constants.py diff --git a/tests/parser/types/numbers/test_decimals.py b/tests/functional/codegen/types/numbers/test_decimals.py similarity index 100% rename from tests/parser/types/numbers/test_decimals.py rename to tests/functional/codegen/types/numbers/test_decimals.py diff --git a/tests/parser/features/arithmetic/test_division.py b/tests/functional/codegen/types/numbers/test_division.py similarity index 100% rename from tests/parser/features/arithmetic/test_division.py rename to tests/functional/codegen/types/numbers/test_division.py diff --git a/tests/fuzzing/test_exponents.py b/tests/functional/codegen/types/numbers/test_exponents.py similarity index 100% rename from tests/fuzzing/test_exponents.py rename to tests/functional/codegen/types/numbers/test_exponents.py diff --git a/tests/parser/types/numbers/test_isqrt.py b/tests/functional/codegen/types/numbers/test_isqrt.py similarity index 100% rename from tests/parser/types/numbers/test_isqrt.py rename to tests/functional/codegen/types/numbers/test_isqrt.py diff --git a/tests/parser/features/arithmetic/test_modulo.py b/tests/functional/codegen/types/numbers/test_modulo.py similarity index 100% rename from tests/parser/features/arithmetic/test_modulo.py rename to tests/functional/codegen/types/numbers/test_modulo.py diff --git a/tests/parser/types/numbers/test_signed_ints.py b/tests/functional/codegen/types/numbers/test_signed_ints.py similarity index 100% rename from tests/parser/types/numbers/test_signed_ints.py rename to tests/functional/codegen/types/numbers/test_signed_ints.py diff --git a/tests/parser/types/numbers/test_sqrt.py b/tests/functional/codegen/types/numbers/test_sqrt.py similarity index 100% rename from tests/parser/types/numbers/test_sqrt.py rename to tests/functional/codegen/types/numbers/test_sqrt.py diff --git a/tests/parser/types/numbers/test_unsigned_ints.py b/tests/functional/codegen/types/numbers/test_unsigned_ints.py similarity index 100% rename from tests/parser/types/numbers/test_unsigned_ints.py rename to tests/functional/codegen/types/numbers/test_unsigned_ints.py diff --git a/tests/parser/types/test_bytes.py b/tests/functional/codegen/types/test_bytes.py similarity index 100% rename from tests/parser/types/test_bytes.py rename to tests/functional/codegen/types/test_bytes.py diff --git a/tests/parser/types/test_bytes_literal.py b/tests/functional/codegen/types/test_bytes_literal.py similarity index 100% rename from tests/parser/types/test_bytes_literal.py rename to tests/functional/codegen/types/test_bytes_literal.py diff --git a/tests/parser/types/test_bytes_zero_padding.py b/tests/functional/codegen/types/test_bytes_zero_padding.py similarity index 100% rename from tests/parser/types/test_bytes_zero_padding.py rename to tests/functional/codegen/types/test_bytes_zero_padding.py diff --git a/tests/parser/types/test_dynamic_array.py b/tests/functional/codegen/types/test_dynamic_array.py similarity index 100% rename from tests/parser/types/test_dynamic_array.py rename to tests/functional/codegen/types/test_dynamic_array.py diff --git a/tests/parser/types/test_enum.py b/tests/functional/codegen/types/test_enum.py similarity index 100% rename from tests/parser/types/test_enum.py rename to tests/functional/codegen/types/test_enum.py diff --git a/tests/parser/types/test_identifier_naming.py b/tests/functional/codegen/types/test_identifier_naming.py old mode 100755 new mode 100644 similarity index 100% rename from tests/parser/types/test_identifier_naming.py rename to tests/functional/codegen/types/test_identifier_naming.py diff --git a/tests/parser/types/test_lists.py b/tests/functional/codegen/types/test_lists.py similarity index 100% rename from tests/parser/types/test_lists.py rename to tests/functional/codegen/types/test_lists.py diff --git a/tests/parser/types/test_node_types.py b/tests/functional/codegen/types/test_node_types.py similarity index 100% rename from tests/parser/types/test_node_types.py rename to tests/functional/codegen/types/test_node_types.py diff --git a/tests/parser/types/test_string.py b/tests/functional/codegen/types/test_string.py similarity index 100% rename from tests/parser/types/test_string.py rename to tests/functional/codegen/types/test_string.py diff --git a/tests/parser/types/test_string_literal.py b/tests/functional/codegen/types/test_string_literal.py similarity index 100% rename from tests/parser/types/test_string_literal.py rename to tests/functional/codegen/types/test_string_literal.py diff --git a/tests/examples/auctions/test_blind_auction.py b/tests/functional/examples/auctions/test_blind_auction.py similarity index 100% rename from tests/examples/auctions/test_blind_auction.py rename to tests/functional/examples/auctions/test_blind_auction.py diff --git a/tests/examples/auctions/test_simple_open_auction.py b/tests/functional/examples/auctions/test_simple_open_auction.py similarity index 100% rename from tests/examples/auctions/test_simple_open_auction.py rename to tests/functional/examples/auctions/test_simple_open_auction.py diff --git a/tests/examples/company/test_company.py b/tests/functional/examples/company/test_company.py similarity index 100% rename from tests/examples/company/test_company.py rename to tests/functional/examples/company/test_company.py diff --git a/tests/examples/conftest.py b/tests/functional/examples/conftest.py similarity index 100% rename from tests/examples/conftest.py rename to tests/functional/examples/conftest.py diff --git a/tests/examples/crowdfund/test_crowdfund_example.py b/tests/functional/examples/crowdfund/test_crowdfund_example.py similarity index 100% rename from tests/examples/crowdfund/test_crowdfund_example.py rename to tests/functional/examples/crowdfund/test_crowdfund_example.py diff --git a/tests/examples/factory/test_factory.py b/tests/functional/examples/factory/test_factory.py similarity index 100% rename from tests/examples/factory/test_factory.py rename to tests/functional/examples/factory/test_factory.py diff --git a/tests/examples/market_maker/test_on_chain_market_maker.py b/tests/functional/examples/market_maker/test_on_chain_market_maker.py similarity index 100% rename from tests/examples/market_maker/test_on_chain_market_maker.py rename to tests/functional/examples/market_maker/test_on_chain_market_maker.py diff --git a/tests/examples/name_registry/test_name_registry.py b/tests/functional/examples/name_registry/test_name_registry.py similarity index 100% rename from tests/examples/name_registry/test_name_registry.py rename to tests/functional/examples/name_registry/test_name_registry.py diff --git a/tests/examples/safe_remote_purchase/test_safe_remote_purchase.py b/tests/functional/examples/safe_remote_purchase/test_safe_remote_purchase.py similarity index 100% rename from tests/examples/safe_remote_purchase/test_safe_remote_purchase.py rename to tests/functional/examples/safe_remote_purchase/test_safe_remote_purchase.py diff --git a/tests/examples/storage/test_advanced_storage.py b/tests/functional/examples/storage/test_advanced_storage.py similarity index 100% rename from tests/examples/storage/test_advanced_storage.py rename to tests/functional/examples/storage/test_advanced_storage.py diff --git a/tests/examples/storage/test_storage.py b/tests/functional/examples/storage/test_storage.py similarity index 100% rename from tests/examples/storage/test_storage.py rename to tests/functional/examples/storage/test_storage.py diff --git a/tests/examples/tokens/test_erc1155.py b/tests/functional/examples/tokens/test_erc1155.py similarity index 100% rename from tests/examples/tokens/test_erc1155.py rename to tests/functional/examples/tokens/test_erc1155.py diff --git a/tests/examples/tokens/test_erc20.py b/tests/functional/examples/tokens/test_erc20.py similarity index 100% rename from tests/examples/tokens/test_erc20.py rename to tests/functional/examples/tokens/test_erc20.py diff --git a/tests/examples/tokens/test_erc4626.py b/tests/functional/examples/tokens/test_erc4626.py similarity index 100% rename from tests/examples/tokens/test_erc4626.py rename to tests/functional/examples/tokens/test_erc4626.py diff --git a/tests/examples/tokens/test_erc721.py b/tests/functional/examples/tokens/test_erc721.py similarity index 100% rename from tests/examples/tokens/test_erc721.py rename to tests/functional/examples/tokens/test_erc721.py diff --git a/tests/examples/voting/test_ballot.py b/tests/functional/examples/voting/test_ballot.py similarity index 100% rename from tests/examples/voting/test_ballot.py rename to tests/functional/examples/voting/test_ballot.py diff --git a/tests/examples/wallet/test_wallet.py b/tests/functional/examples/wallet/test_wallet.py similarity index 100% rename from tests/examples/wallet/test_wallet.py rename to tests/functional/examples/wallet/test_wallet.py diff --git a/tests/grammar/test_grammar.py b/tests/functional/grammar/test_grammar.py similarity index 100% rename from tests/grammar/test_grammar.py rename to tests/functional/grammar/test_grammar.py diff --git a/tests/parser/syntax/__init__.py b/tests/functional/syntax/__init__.py similarity index 100% rename from tests/parser/syntax/__init__.py rename to tests/functional/syntax/__init__.py diff --git a/tests/parser/exceptions/test_argument_exception.py b/tests/functional/syntax/exceptions/test_argument_exception.py similarity index 100% rename from tests/parser/exceptions/test_argument_exception.py rename to tests/functional/syntax/exceptions/test_argument_exception.py diff --git a/tests/parser/exceptions/test_call_violation.py b/tests/functional/syntax/exceptions/test_call_violation.py similarity index 100% rename from tests/parser/exceptions/test_call_violation.py rename to tests/functional/syntax/exceptions/test_call_violation.py diff --git a/tests/parser/exceptions/test_constancy_exception.py b/tests/functional/syntax/exceptions/test_constancy_exception.py similarity index 100% rename from tests/parser/exceptions/test_constancy_exception.py rename to tests/functional/syntax/exceptions/test_constancy_exception.py diff --git a/tests/parser/exceptions/test_function_declaration_exception.py b/tests/functional/syntax/exceptions/test_function_declaration_exception.py similarity index 100% rename from tests/parser/exceptions/test_function_declaration_exception.py rename to tests/functional/syntax/exceptions/test_function_declaration_exception.py diff --git a/tests/parser/exceptions/test_instantiation_exception.py b/tests/functional/syntax/exceptions/test_instantiation_exception.py similarity index 100% rename from tests/parser/exceptions/test_instantiation_exception.py rename to tests/functional/syntax/exceptions/test_instantiation_exception.py diff --git a/tests/parser/exceptions/test_invalid_literal_exception.py b/tests/functional/syntax/exceptions/test_invalid_literal_exception.py similarity index 100% rename from tests/parser/exceptions/test_invalid_literal_exception.py rename to tests/functional/syntax/exceptions/test_invalid_literal_exception.py diff --git a/tests/parser/exceptions/test_invalid_payable.py b/tests/functional/syntax/exceptions/test_invalid_payable.py similarity index 100% rename from tests/parser/exceptions/test_invalid_payable.py rename to tests/functional/syntax/exceptions/test_invalid_payable.py diff --git a/tests/parser/exceptions/test_invalid_reference.py b/tests/functional/syntax/exceptions/test_invalid_reference.py similarity index 100% rename from tests/parser/exceptions/test_invalid_reference.py rename to tests/functional/syntax/exceptions/test_invalid_reference.py diff --git a/tests/parser/exceptions/test_invalid_type_exception.py b/tests/functional/syntax/exceptions/test_invalid_type_exception.py similarity index 100% rename from tests/parser/exceptions/test_invalid_type_exception.py rename to tests/functional/syntax/exceptions/test_invalid_type_exception.py diff --git a/tests/parser/exceptions/test_namespace_collision.py b/tests/functional/syntax/exceptions/test_namespace_collision.py similarity index 100% rename from tests/parser/exceptions/test_namespace_collision.py rename to tests/functional/syntax/exceptions/test_namespace_collision.py diff --git a/tests/parser/exceptions/test_overflow_exception.py b/tests/functional/syntax/exceptions/test_overflow_exception.py similarity index 100% rename from tests/parser/exceptions/test_overflow_exception.py rename to tests/functional/syntax/exceptions/test_overflow_exception.py diff --git a/tests/parser/exceptions/test_structure_exception.py b/tests/functional/syntax/exceptions/test_structure_exception.py similarity index 100% rename from tests/parser/exceptions/test_structure_exception.py rename to tests/functional/syntax/exceptions/test_structure_exception.py diff --git a/tests/parser/exceptions/test_syntax_exception.py b/tests/functional/syntax/exceptions/test_syntax_exception.py similarity index 100% rename from tests/parser/exceptions/test_syntax_exception.py rename to tests/functional/syntax/exceptions/test_syntax_exception.py diff --git a/tests/parser/exceptions/test_type_mismatch_exception.py b/tests/functional/syntax/exceptions/test_type_mismatch_exception.py similarity index 100% rename from tests/parser/exceptions/test_type_mismatch_exception.py rename to tests/functional/syntax/exceptions/test_type_mismatch_exception.py diff --git a/tests/parser/exceptions/test_undeclared_definition.py b/tests/functional/syntax/exceptions/test_undeclared_definition.py similarity index 100% rename from tests/parser/exceptions/test_undeclared_definition.py rename to tests/functional/syntax/exceptions/test_undeclared_definition.py diff --git a/tests/parser/exceptions/test_variable_declaration_exception.py b/tests/functional/syntax/exceptions/test_variable_declaration_exception.py similarity index 100% rename from tests/parser/exceptions/test_variable_declaration_exception.py rename to tests/functional/syntax/exceptions/test_variable_declaration_exception.py diff --git a/tests/parser/exceptions/test_vyper_exception_pos.py b/tests/functional/syntax/exceptions/test_vyper_exception_pos.py similarity index 100% rename from tests/parser/exceptions/test_vyper_exception_pos.py rename to tests/functional/syntax/exceptions/test_vyper_exception_pos.py diff --git a/tests/parser/syntax/utils/test_event_names.py b/tests/functional/syntax/names/test_event_names.py similarity index 100% rename from tests/parser/syntax/utils/test_event_names.py rename to tests/functional/syntax/names/test_event_names.py diff --git a/tests/parser/syntax/utils/test_function_names.py b/tests/functional/syntax/names/test_function_names.py similarity index 100% rename from tests/parser/syntax/utils/test_function_names.py rename to tests/functional/syntax/names/test_function_names.py diff --git a/tests/parser/syntax/utils/test_variable_names.py b/tests/functional/syntax/names/test_variable_names.py similarity index 100% rename from tests/parser/syntax/utils/test_variable_names.py rename to tests/functional/syntax/names/test_variable_names.py diff --git a/tests/signatures/test_invalid_function_decorators.py b/tests/functional/syntax/signatures/test_invalid_function_decorators.py similarity index 100% rename from tests/signatures/test_invalid_function_decorators.py rename to tests/functional/syntax/signatures/test_invalid_function_decorators.py diff --git a/tests/signatures/test_method_id_conflicts.py b/tests/functional/syntax/signatures/test_method_id_conflicts.py similarity index 100% rename from tests/signatures/test_method_id_conflicts.py rename to tests/functional/syntax/signatures/test_method_id_conflicts.py diff --git a/tests/parser/syntax/test_abi_decode.py b/tests/functional/syntax/test_abi_decode.py similarity index 100% rename from tests/parser/syntax/test_abi_decode.py rename to tests/functional/syntax/test_abi_decode.py diff --git a/tests/parser/syntax/test_abi_encode.py b/tests/functional/syntax/test_abi_encode.py similarity index 100% rename from tests/parser/syntax/test_abi_encode.py rename to tests/functional/syntax/test_abi_encode.py diff --git a/tests/parser/syntax/test_addmulmod.py b/tests/functional/syntax/test_addmulmod.py similarity index 100% rename from tests/parser/syntax/test_addmulmod.py rename to tests/functional/syntax/test_addmulmod.py diff --git a/tests/parser/syntax/test_address_code.py b/tests/functional/syntax/test_address_code.py similarity index 100% rename from tests/parser/syntax/test_address_code.py rename to tests/functional/syntax/test_address_code.py diff --git a/tests/parser/syntax/test_ann_assign.py b/tests/functional/syntax/test_ann_assign.py similarity index 100% rename from tests/parser/syntax/test_ann_assign.py rename to tests/functional/syntax/test_ann_assign.py diff --git a/tests/parser/syntax/test_as_uint256.py b/tests/functional/syntax/test_as_uint256.py similarity index 100% rename from tests/parser/syntax/test_as_uint256.py rename to tests/functional/syntax/test_as_uint256.py diff --git a/tests/parser/syntax/test_as_wei_value.py b/tests/functional/syntax/test_as_wei_value.py similarity index 100% rename from tests/parser/syntax/test_as_wei_value.py rename to tests/functional/syntax/test_as_wei_value.py diff --git a/tests/parser/syntax/test_block.py b/tests/functional/syntax/test_block.py similarity index 100% rename from tests/parser/syntax/test_block.py rename to tests/functional/syntax/test_block.py diff --git a/tests/parser/syntax/test_blockscope.py b/tests/functional/syntax/test_blockscope.py similarity index 100% rename from tests/parser/syntax/test_blockscope.py rename to tests/functional/syntax/test_blockscope.py diff --git a/tests/parser/syntax/test_bool.py b/tests/functional/syntax/test_bool.py similarity index 100% rename from tests/parser/syntax/test_bool.py rename to tests/functional/syntax/test_bool.py diff --git a/tests/parser/syntax/test_bool_ops.py b/tests/functional/syntax/test_bool_ops.py similarity index 100% rename from tests/parser/syntax/test_bool_ops.py rename to tests/functional/syntax/test_bool_ops.py diff --git a/tests/parser/syntax/test_bytes.py b/tests/functional/syntax/test_bytes.py similarity index 100% rename from tests/parser/syntax/test_bytes.py rename to tests/functional/syntax/test_bytes.py diff --git a/tests/parser/syntax/test_chainid.py b/tests/functional/syntax/test_chainid.py similarity index 100% rename from tests/parser/syntax/test_chainid.py rename to tests/functional/syntax/test_chainid.py diff --git a/tests/parser/syntax/test_code_size.py b/tests/functional/syntax/test_code_size.py similarity index 100% rename from tests/parser/syntax/test_code_size.py rename to tests/functional/syntax/test_code_size.py diff --git a/tests/parser/syntax/test_codehash.py b/tests/functional/syntax/test_codehash.py similarity index 100% rename from tests/parser/syntax/test_codehash.py rename to tests/functional/syntax/test_codehash.py diff --git a/tests/parser/syntax/test_concat.py b/tests/functional/syntax/test_concat.py similarity index 100% rename from tests/parser/syntax/test_concat.py rename to tests/functional/syntax/test_concat.py diff --git a/tests/parser/syntax/test_conditionals.py b/tests/functional/syntax/test_conditionals.py similarity index 100% rename from tests/parser/syntax/test_conditionals.py rename to tests/functional/syntax/test_conditionals.py diff --git a/tests/parser/syntax/test_constants.py b/tests/functional/syntax/test_constants.py similarity index 100% rename from tests/parser/syntax/test_constants.py rename to tests/functional/syntax/test_constants.py diff --git a/tests/parser/syntax/test_create_with_code_of.py b/tests/functional/syntax/test_create_with_code_of.py similarity index 100% rename from tests/parser/syntax/test_create_with_code_of.py rename to tests/functional/syntax/test_create_with_code_of.py diff --git a/tests/parser/syntax/test_dynamic_array.py b/tests/functional/syntax/test_dynamic_array.py similarity index 100% rename from tests/parser/syntax/test_dynamic_array.py rename to tests/functional/syntax/test_dynamic_array.py diff --git a/tests/parser/syntax/test_enum.py b/tests/functional/syntax/test_enum.py similarity index 100% rename from tests/parser/syntax/test_enum.py rename to tests/functional/syntax/test_enum.py diff --git a/tests/parser/syntax/test_extract32.py b/tests/functional/syntax/test_extract32.py similarity index 100% rename from tests/parser/syntax/test_extract32.py rename to tests/functional/syntax/test_extract32.py diff --git a/tests/parser/syntax/test_for_range.py b/tests/functional/syntax/test_for_range.py similarity index 100% rename from tests/parser/syntax/test_for_range.py rename to tests/functional/syntax/test_for_range.py diff --git a/tests/parser/syntax/test_functions_call.py b/tests/functional/syntax/test_functions_call.py similarity index 100% rename from tests/parser/syntax/test_functions_call.py rename to tests/functional/syntax/test_functions_call.py diff --git a/tests/parser/syntax/test_immutables.py b/tests/functional/syntax/test_immutables.py similarity index 100% rename from tests/parser/syntax/test_immutables.py rename to tests/functional/syntax/test_immutables.py diff --git a/tests/parser/syntax/test_interfaces.py b/tests/functional/syntax/test_interfaces.py similarity index 100% rename from tests/parser/syntax/test_interfaces.py rename to tests/functional/syntax/test_interfaces.py diff --git a/tests/parser/syntax/test_invalids.py b/tests/functional/syntax/test_invalids.py similarity index 100% rename from tests/parser/syntax/test_invalids.py rename to tests/functional/syntax/test_invalids.py diff --git a/tests/parser/syntax/test_keccak256.py b/tests/functional/syntax/test_keccak256.py similarity index 100% rename from tests/parser/syntax/test_keccak256.py rename to tests/functional/syntax/test_keccak256.py diff --git a/tests/parser/syntax/test_len.py b/tests/functional/syntax/test_len.py similarity index 100% rename from tests/parser/syntax/test_len.py rename to tests/functional/syntax/test_len.py diff --git a/tests/parser/syntax/test_list.py b/tests/functional/syntax/test_list.py similarity index 100% rename from tests/parser/syntax/test_list.py rename to tests/functional/syntax/test_list.py diff --git a/tests/parser/syntax/test_logging.py b/tests/functional/syntax/test_logging.py similarity index 100% rename from tests/parser/syntax/test_logging.py rename to tests/functional/syntax/test_logging.py diff --git a/tests/parser/syntax/test_minmax.py b/tests/functional/syntax/test_minmax.py similarity index 100% rename from tests/parser/syntax/test_minmax.py rename to tests/functional/syntax/test_minmax.py diff --git a/tests/parser/syntax/test_minmax_value.py b/tests/functional/syntax/test_minmax_value.py similarity index 100% rename from tests/parser/syntax/test_minmax_value.py rename to tests/functional/syntax/test_minmax_value.py diff --git a/tests/parser/syntax/test_msg_data.py b/tests/functional/syntax/test_msg_data.py similarity index 100% rename from tests/parser/syntax/test_msg_data.py rename to tests/functional/syntax/test_msg_data.py diff --git a/tests/parser/syntax/test_nested_list.py b/tests/functional/syntax/test_nested_list.py similarity index 100% rename from tests/parser/syntax/test_nested_list.py rename to tests/functional/syntax/test_nested_list.py diff --git a/tests/parser/syntax/test_no_none.py b/tests/functional/syntax/test_no_none.py similarity index 100% rename from tests/parser/syntax/test_no_none.py rename to tests/functional/syntax/test_no_none.py diff --git a/tests/parser/syntax/test_print.py b/tests/functional/syntax/test_print.py similarity index 100% rename from tests/parser/syntax/test_print.py rename to tests/functional/syntax/test_print.py diff --git a/tests/parser/syntax/test_public.py b/tests/functional/syntax/test_public.py similarity index 100% rename from tests/parser/syntax/test_public.py rename to tests/functional/syntax/test_public.py diff --git a/tests/parser/syntax/test_raw_call.py b/tests/functional/syntax/test_raw_call.py similarity index 100% rename from tests/parser/syntax/test_raw_call.py rename to tests/functional/syntax/test_raw_call.py diff --git a/tests/parser/syntax/test_return_tuple.py b/tests/functional/syntax/test_return_tuple.py similarity index 100% rename from tests/parser/syntax/test_return_tuple.py rename to tests/functional/syntax/test_return_tuple.py diff --git a/tests/parser/syntax/test_self_balance.py b/tests/functional/syntax/test_self_balance.py similarity index 100% rename from tests/parser/syntax/test_self_balance.py rename to tests/functional/syntax/test_self_balance.py diff --git a/tests/parser/syntax/test_selfdestruct.py b/tests/functional/syntax/test_selfdestruct.py similarity index 100% rename from tests/parser/syntax/test_selfdestruct.py rename to tests/functional/syntax/test_selfdestruct.py diff --git a/tests/parser/syntax/test_send.py b/tests/functional/syntax/test_send.py similarity index 100% rename from tests/parser/syntax/test_send.py rename to tests/functional/syntax/test_send.py diff --git a/tests/parser/syntax/test_slice.py b/tests/functional/syntax/test_slice.py similarity index 100% rename from tests/parser/syntax/test_slice.py rename to tests/functional/syntax/test_slice.py diff --git a/tests/parser/syntax/test_string.py b/tests/functional/syntax/test_string.py similarity index 100% rename from tests/parser/syntax/test_string.py rename to tests/functional/syntax/test_string.py diff --git a/tests/parser/syntax/test_structs.py b/tests/functional/syntax/test_structs.py similarity index 100% rename from tests/parser/syntax/test_structs.py rename to tests/functional/syntax/test_structs.py diff --git a/tests/parser/syntax/test_ternary.py b/tests/functional/syntax/test_ternary.py similarity index 100% rename from tests/parser/syntax/test_ternary.py rename to tests/functional/syntax/test_ternary.py diff --git a/tests/parser/syntax/test_tuple_assign.py b/tests/functional/syntax/test_tuple_assign.py similarity index 100% rename from tests/parser/syntax/test_tuple_assign.py rename to tests/functional/syntax/test_tuple_assign.py diff --git a/tests/parser/syntax/test_unbalanced_return.py b/tests/functional/syntax/test_unbalanced_return.py similarity index 100% rename from tests/parser/syntax/test_unbalanced_return.py rename to tests/functional/syntax/test_unbalanced_return.py diff --git a/tests/parser/functions/test_as_wei_value.py b/tests/parser/functions/test_as_wei_value.py deleted file mode 100644 index bab0aed616..0000000000 --- a/tests/parser/functions/test_as_wei_value.py +++ /dev/null @@ -1,31 +0,0 @@ -def test_ext_call(w3, side_effects_contract, assert_side_effects_invoked, get_contract): - code = """ -@external -def foo(a: Foo) -> uint256: - return as_wei_value(a.foo(7), "ether") - -interface Foo: - def foo(x: uint8) -> uint8: nonpayable - """ - - c1 = side_effects_contract("uint8") - c2 = get_contract(code) - - assert c2.foo(c1.address) == w3.to_wei(7, "ether") - assert_side_effects_invoked(c1, lambda: c2.foo(c1.address, transact={})) - - -def test_internal_call(w3, get_contract_with_gas_estimation): - code = """ -@external -def foo() -> uint256: - return as_wei_value(self.bar(), "ether") - -@internal -def bar() -> uint8: - return 7 - """ - - c = get_contract_with_gas_estimation(code) - - assert c.foo() == w3.to_wei(7, "ether") diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/abi_types/test_invalid_abi_types.py b/tests/unit/abi_types/test_invalid_abi_types.py similarity index 100% rename from tests/abi_types/test_invalid_abi_types.py rename to tests/unit/abi_types/test_invalid_abi_types.py diff --git a/tests/ast/nodes/test_binary.py b/tests/unit/ast/nodes/test_binary.py similarity index 100% rename from tests/ast/nodes/test_binary.py rename to tests/unit/ast/nodes/test_binary.py diff --git a/tests/ast/nodes/test_compare_nodes.py b/tests/unit/ast/nodes/test_compare_nodes.py similarity index 100% rename from tests/ast/nodes/test_compare_nodes.py rename to tests/unit/ast/nodes/test_compare_nodes.py diff --git a/tests/ast/nodes/test_evaluate_binop_decimal.py b/tests/unit/ast/nodes/test_evaluate_binop_decimal.py similarity index 100% rename from tests/ast/nodes/test_evaluate_binop_decimal.py rename to tests/unit/ast/nodes/test_evaluate_binop_decimal.py diff --git a/tests/ast/nodes/test_evaluate_binop_int.py b/tests/unit/ast/nodes/test_evaluate_binop_int.py similarity index 100% rename from tests/ast/nodes/test_evaluate_binop_int.py rename to tests/unit/ast/nodes/test_evaluate_binop_int.py diff --git a/tests/ast/nodes/test_evaluate_boolop.py b/tests/unit/ast/nodes/test_evaluate_boolop.py similarity index 100% rename from tests/ast/nodes/test_evaluate_boolop.py rename to tests/unit/ast/nodes/test_evaluate_boolop.py diff --git a/tests/ast/nodes/test_evaluate_compare.py b/tests/unit/ast/nodes/test_evaluate_compare.py similarity index 100% rename from tests/ast/nodes/test_evaluate_compare.py rename to tests/unit/ast/nodes/test_evaluate_compare.py diff --git a/tests/ast/nodes/test_evaluate_subscript.py b/tests/unit/ast/nodes/test_evaluate_subscript.py similarity index 100% rename from tests/ast/nodes/test_evaluate_subscript.py rename to tests/unit/ast/nodes/test_evaluate_subscript.py diff --git a/tests/ast/nodes/test_evaluate_unaryop.py b/tests/unit/ast/nodes/test_evaluate_unaryop.py similarity index 100% rename from tests/ast/nodes/test_evaluate_unaryop.py rename to tests/unit/ast/nodes/test_evaluate_unaryop.py diff --git a/tests/ast/nodes/test_from_node.py b/tests/unit/ast/nodes/test_from_node.py similarity index 100% rename from tests/ast/nodes/test_from_node.py rename to tests/unit/ast/nodes/test_from_node.py diff --git a/tests/ast/nodes/test_get_children.py b/tests/unit/ast/nodes/test_get_children.py similarity index 100% rename from tests/ast/nodes/test_get_children.py rename to tests/unit/ast/nodes/test_get_children.py diff --git a/tests/ast/nodes/test_get_descendants.py b/tests/unit/ast/nodes/test_get_descendants.py similarity index 100% rename from tests/ast/nodes/test_get_descendants.py rename to tests/unit/ast/nodes/test_get_descendants.py diff --git a/tests/ast/nodes/test_hex.py b/tests/unit/ast/nodes/test_hex.py similarity index 100% rename from tests/ast/nodes/test_hex.py rename to tests/unit/ast/nodes/test_hex.py diff --git a/tests/ast/nodes/test_replace_in_tree.py b/tests/unit/ast/nodes/test_replace_in_tree.py similarity index 100% rename from tests/ast/nodes/test_replace_in_tree.py rename to tests/unit/ast/nodes/test_replace_in_tree.py diff --git a/tests/parser/parser_utils/test_annotate_and_optimize_ast.py b/tests/unit/ast/test_annotate_and_optimize_ast.py similarity index 100% rename from tests/parser/parser_utils/test_annotate_and_optimize_ast.py rename to tests/unit/ast/test_annotate_and_optimize_ast.py diff --git a/tests/parser/ast_utils/test_ast_dict.py b/tests/unit/ast/test_ast_dict.py similarity index 100% rename from tests/parser/ast_utils/test_ast_dict.py rename to tests/unit/ast/test_ast_dict.py diff --git a/tests/ast/test_folding.py b/tests/unit/ast/test_folding.py similarity index 100% rename from tests/ast/test_folding.py rename to tests/unit/ast/test_folding.py diff --git a/tests/ast/test_metadata_journal.py b/tests/unit/ast/test_metadata_journal.py similarity index 100% rename from tests/ast/test_metadata_journal.py rename to tests/unit/ast/test_metadata_journal.py diff --git a/tests/ast/test_natspec.py b/tests/unit/ast/test_natspec.py similarity index 100% rename from tests/ast/test_natspec.py rename to tests/unit/ast/test_natspec.py diff --git a/tests/parser/ast_utils/test_ast.py b/tests/unit/ast/test_parser.py similarity index 100% rename from tests/parser/ast_utils/test_ast.py rename to tests/unit/ast/test_parser.py diff --git a/tests/ast/test_pre_parser.py b/tests/unit/ast/test_pre_parser.py similarity index 100% rename from tests/ast/test_pre_parser.py rename to tests/unit/ast/test_pre_parser.py diff --git a/tests/test_utils.py b/tests/unit/ast/test_source_annotation.py similarity index 100% rename from tests/test_utils.py rename to tests/unit/ast/test_source_annotation.py diff --git a/tests/cli/outputs/test_storage_layout.py b/tests/unit/cli/outputs/test_storage_layout.py similarity index 100% rename from tests/cli/outputs/test_storage_layout.py rename to tests/unit/cli/outputs/test_storage_layout.py diff --git a/tests/cli/outputs/test_storage_layout_overrides.py b/tests/unit/cli/outputs/test_storage_layout_overrides.py similarity index 100% rename from tests/cli/outputs/test_storage_layout_overrides.py rename to tests/unit/cli/outputs/test_storage_layout_overrides.py diff --git a/tests/cli/vyper_compile/test_compile_files.py b/tests/unit/cli/vyper_compile/test_compile_files.py similarity index 100% rename from tests/cli/vyper_compile/test_compile_files.py rename to tests/unit/cli/vyper_compile/test_compile_files.py diff --git a/tests/cli/vyper_compile/test_parse_args.py b/tests/unit/cli/vyper_compile/test_parse_args.py similarity index 100% rename from tests/cli/vyper_compile/test_parse_args.py rename to tests/unit/cli/vyper_compile/test_parse_args.py diff --git a/tests/cli/vyper_json/test_compile_json.py b/tests/unit/cli/vyper_json/test_compile_json.py similarity index 100% rename from tests/cli/vyper_json/test_compile_json.py rename to tests/unit/cli/vyper_json/test_compile_json.py diff --git a/tests/cli/vyper_json/test_get_inputs.py b/tests/unit/cli/vyper_json/test_get_inputs.py similarity index 100% rename from tests/cli/vyper_json/test_get_inputs.py rename to tests/unit/cli/vyper_json/test_get_inputs.py diff --git a/tests/cli/vyper_json/test_get_settings.py b/tests/unit/cli/vyper_json/test_get_settings.py similarity index 100% rename from tests/cli/vyper_json/test_get_settings.py rename to tests/unit/cli/vyper_json/test_get_settings.py diff --git a/tests/cli/vyper_json/test_output_selection.py b/tests/unit/cli/vyper_json/test_output_selection.py similarity index 100% rename from tests/cli/vyper_json/test_output_selection.py rename to tests/unit/cli/vyper_json/test_output_selection.py diff --git a/tests/cli/vyper_json/test_parse_args_vyperjson.py b/tests/unit/cli/vyper_json/test_parse_args_vyperjson.py similarity index 100% rename from tests/cli/vyper_json/test_parse_args_vyperjson.py rename to tests/unit/cli/vyper_json/test_parse_args_vyperjson.py diff --git a/tests/compiler/__init__.py b/tests/unit/compiler/__init__.py similarity index 100% rename from tests/compiler/__init__.py rename to tests/unit/compiler/__init__.py diff --git a/tests/compiler/asm/test_asm_optimizer.py b/tests/unit/compiler/asm/test_asm_optimizer.py similarity index 100% rename from tests/compiler/asm/test_asm_optimizer.py rename to tests/unit/compiler/asm/test_asm_optimizer.py diff --git a/tests/unit/compiler/ir/__init__.py b/tests/unit/compiler/ir/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/compiler/test_calldatacopy.py b/tests/unit/compiler/ir/test_calldatacopy.py similarity index 100% rename from tests/compiler/test_calldatacopy.py rename to tests/unit/compiler/ir/test_calldatacopy.py diff --git a/tests/compiler/ir/test_compile_ir.py b/tests/unit/compiler/ir/test_compile_ir.py similarity index 100% rename from tests/compiler/ir/test_compile_ir.py rename to tests/unit/compiler/ir/test_compile_ir.py diff --git a/tests/compiler/ir/test_optimize_ir.py b/tests/unit/compiler/ir/test_optimize_ir.py similarity index 100% rename from tests/compiler/ir/test_optimize_ir.py rename to tests/unit/compiler/ir/test_optimize_ir.py diff --git a/tests/compiler/ir/test_repeat.py b/tests/unit/compiler/ir/test_repeat.py similarity index 100% rename from tests/compiler/ir/test_repeat.py rename to tests/unit/compiler/ir/test_repeat.py diff --git a/tests/compiler/ir/test_with.py b/tests/unit/compiler/ir/test_with.py similarity index 100% rename from tests/compiler/ir/test_with.py rename to tests/unit/compiler/ir/test_with.py diff --git a/tests/compiler/test_bytecode_runtime.py b/tests/unit/compiler/test_bytecode_runtime.py similarity index 100% rename from tests/compiler/test_bytecode_runtime.py rename to tests/unit/compiler/test_bytecode_runtime.py diff --git a/tests/compiler/test_compile_code.py b/tests/unit/compiler/test_compile_code.py similarity index 100% rename from tests/compiler/test_compile_code.py rename to tests/unit/compiler/test_compile_code.py diff --git a/tests/compiler/test_default_settings.py b/tests/unit/compiler/test_default_settings.py similarity index 100% rename from tests/compiler/test_default_settings.py rename to tests/unit/compiler/test_default_settings.py diff --git a/tests/compiler/test_input_bundle.py b/tests/unit/compiler/test_input_bundle.py similarity index 100% rename from tests/compiler/test_input_bundle.py rename to tests/unit/compiler/test_input_bundle.py diff --git a/tests/compiler/test_opcodes.py b/tests/unit/compiler/test_opcodes.py similarity index 100% rename from tests/compiler/test_opcodes.py rename to tests/unit/compiler/test_opcodes.py diff --git a/tests/compiler/test_pre_parser.py b/tests/unit/compiler/test_pre_parser.py similarity index 100% rename from tests/compiler/test_pre_parser.py rename to tests/unit/compiler/test_pre_parser.py diff --git a/tests/compiler/test_sha3_32.py b/tests/unit/compiler/test_sha3_32.py similarity index 100% rename from tests/compiler/test_sha3_32.py rename to tests/unit/compiler/test_sha3_32.py diff --git a/tests/compiler/test_source_map.py b/tests/unit/compiler/test_source_map.py similarity index 100% rename from tests/compiler/test_source_map.py rename to tests/unit/compiler/test_source_map.py diff --git a/tests/functional/semantics/analysis/test_array_index.py b/tests/unit/semantics/analysis/test_array_index.py similarity index 100% rename from tests/functional/semantics/analysis/test_array_index.py rename to tests/unit/semantics/analysis/test_array_index.py diff --git a/tests/functional/semantics/analysis/test_cyclic_function_calls.py b/tests/unit/semantics/analysis/test_cyclic_function_calls.py similarity index 100% rename from tests/functional/semantics/analysis/test_cyclic_function_calls.py rename to tests/unit/semantics/analysis/test_cyclic_function_calls.py diff --git a/tests/functional/semantics/analysis/test_for_loop.py b/tests/unit/semantics/analysis/test_for_loop.py similarity index 100% rename from tests/functional/semantics/analysis/test_for_loop.py rename to tests/unit/semantics/analysis/test_for_loop.py diff --git a/tests/functional/semantics/analysis/test_potential_types.py b/tests/unit/semantics/analysis/test_potential_types.py similarity index 100% rename from tests/functional/semantics/analysis/test_potential_types.py rename to tests/unit/semantics/analysis/test_potential_types.py diff --git a/tests/functional/semantics/conftest.py b/tests/unit/semantics/conftest.py similarity index 100% rename from tests/functional/semantics/conftest.py rename to tests/unit/semantics/conftest.py diff --git a/tests/functional/semantics/test_namespace.py b/tests/unit/semantics/test_namespace.py similarity index 100% rename from tests/functional/semantics/test_namespace.py rename to tests/unit/semantics/test_namespace.py diff --git a/tests/functional/test_storage_slots.py b/tests/unit/semantics/test_storage_slots.py similarity index 100% rename from tests/functional/test_storage_slots.py rename to tests/unit/semantics/test_storage_slots.py diff --git a/tests/functional/semantics/types/test_event.py b/tests/unit/semantics/types/test_event.py similarity index 100% rename from tests/functional/semantics/types/test_event.py rename to tests/unit/semantics/types/test_event.py diff --git a/tests/functional/semantics/types/test_pure_types.py b/tests/unit/semantics/types/test_pure_types.py similarity index 100% rename from tests/functional/semantics/types/test_pure_types.py rename to tests/unit/semantics/types/test_pure_types.py diff --git a/tests/functional/semantics/types/test_size_in_bytes.py b/tests/unit/semantics/types/test_size_in_bytes.py similarity index 100% rename from tests/functional/semantics/types/test_size_in_bytes.py rename to tests/unit/semantics/types/test_size_in_bytes.py diff --git a/tests/functional/semantics/types/test_type_from_abi.py b/tests/unit/semantics/types/test_type_from_abi.py similarity index 100% rename from tests/functional/semantics/types/test_type_from_abi.py rename to tests/unit/semantics/types/test_type_from_abi.py diff --git a/tests/functional/semantics/types/test_type_from_annotation.py b/tests/unit/semantics/types/test_type_from_annotation.py similarity index 100% rename from tests/functional/semantics/types/test_type_from_annotation.py rename to tests/unit/semantics/types/test_type_from_annotation.py