Skip to content

Commit

Permalink
tests: adapt tests for new compilerapi
Browse files Browse the repository at this point in the history
  • Loading branch information
bilbeyt committed Aug 30, 2023
1 parent 8ca116a commit 6a22d8f
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 3 deletions.
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,11 @@ def wrapper(fn):
for name in names:
# Compilers
if name in ("solidity", "vyper"):
compiler = ape.compilers.get_compiler(name)
if compiler:
try:
ape.compilers.get_compiler(name)
except ValueError:
print(f"Compiler not found: {name}")
else:

def test_skip_from_compiler():
pytest.mark.skip(msg_f.format(name))
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,12 @@ def project_with_contract(temp_config):
def project_with_source_files_contract(temp_config):
bases_source_dir = BASE_SOURCES_DIRECTORY
project_source_dir = APE_PROJECT_FOLDER
data = {"ethereum": {"compilers": ["ethpm"]}}

with temp_config() as project:
with temp_config(data) as project:
copy_tree(str(project_source_dir), str(project.path))
copy_tree(str(bases_source_dir), f"{project.path}/contracts/")
breakpoint()
yield project


Expand Down
4 changes: 4 additions & 0 deletions tests/functional/data/projects/ApeProject/ape-config.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
contracts_folder: ./contracts

ethereum:
compilers:
- ethpm
3 changes: 3 additions & 0 deletions tests/integration/cli/projects/empty-config/ape-config.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Empty config
ethereum:
compilers:
- ethpm
2 changes: 2 additions & 0 deletions tests/integration/cli/projects/geth/ape-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ethereum:
local:
default_provider: geth
compilers:
- ethpm

# Change the default URI for one of the networks to
# ensure that the default values of the other networks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ compile:
# NOTE: this should say `include_dependencies: false` below.
# (it gets replaced with `true` in a test temporarily)
include_dependencies: false

ethereum:
compilers:
- ethpm
4 changes: 4 additions & 0 deletions tests/integration/cli/projects/test/ape-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
test:
# `false` because running pytest within pytest.
disconnect_providers_after: false

ethereum:
compilers:
- ethpm
4 changes: 4 additions & 0 deletions tests/integration/cli/projects/with-contracts/ape-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ compile:
exclude:
- exclude_dir/*
- Excl*.json

ethereum:
compilers:
- ethpm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ dependencies:

- name: renamed-contracts-folder-specified-in-config
local: ./renamed_contracts_folder_specified_in_config

ethereum:
compilers:
- ethpm
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dependencies:
- name: sub-dependency
local: ./sub_dependency

ethereum:
compilers:
- ethpm
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
contracts_folder: my_contracts

ethereum:
compilers:
- ethpm

0 comments on commit 6a22d8f

Please sign in to comment.