From 228b357c61f0364af169bab7c435d092e96bd9ea Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Fri, 27 Sep 2024 20:40:51 -0500 Subject: [PATCH] test: debug this --- tests/ape-config.yaml => ape-config.yaml | 4 +-- tests/conftest.py | 28 +------------------ .../subdir/zero_four_in_subdir.vy | 2 +- .../contracts/passing_contracts/use_iface.vy | 2 +- 4 files changed, 5 insertions(+), 31 deletions(-) rename tests/ape-config.yaml => ape-config.yaml (82%) diff --git a/tests/ape-config.yaml b/ape-config.yaml similarity index 82% rename from tests/ape-config.yaml rename to ape-config.yaml index 53b450e..4bac66d 100644 --- a/tests/ape-config.yaml +++ b/ape-config.yaml @@ -1,10 +1,10 @@ # Allows compiling to work from the project-level. -contracts_folder: contracts/passing_contracts +contracts_folder: tests/contracts/passing_contracts # Specify a dependency to use in Vyper imports. dependencies: - name: exampledependency - local: ./ExampleDependency + local: ./tests/ExampleDependency # NOTE: Snekmate does not need to be listed here since # it is installed in site-packages. However, we include it diff --git a/tests/conftest.py b/tests/conftest.py index 9ee1cd3..803f615 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -135,33 +135,7 @@ def compiler(compiler_manager): @pytest.fixture(scope="session", autouse=True) def project(config): - project_source_dir = Path(__file__).parent - os.chdir(project_source_dir) - project = ape.Project(project_source_dir) - config.local_project = project - return project - # - # # For increasing speed of debugging tests, allows not having - # # to re-compile every time. - # allow_cache = os.environ.get("APE_VYPER_TESTING_USE_CACHE", "0").lower() not in ( - # False, - # "f", - # 0, - # "0", - # "false", - # ) - # - # if allow_cache: - # yield root_project - # - # else: - # # NOTE: This is what CI/CD does. - # # Delete build / .cache that may exist pre-copy - # cache = project_source_dir / ".build" - # shutil.rmtree(cache, ignore_errors=True) - # - # with root_project.isolate_in_tempdir() as tmp_project: - # yield tmp_project + return config.local_project @pytest.fixture diff --git a/tests/contracts/passing_contracts/subdir/zero_four_in_subdir.vy b/tests/contracts/passing_contracts/subdir/zero_four_in_subdir.vy index b3091c9..980bcaf 100644 --- a/tests/contracts/passing_contracts/subdir/zero_four_in_subdir.vy +++ b/tests/contracts/passing_contracts/subdir/zero_four_in_subdir.vy @@ -1,5 +1,5 @@ # Show we can import from the root of the project w/o needing relative imports -from contracts.passing_contracts import zero_four_module as zero_four_module +from tests.contracts.passing_contracts import zero_four_module as zero_four_module @external def callModuleFunctionFromSubdir(role: bytes32) -> bool: diff --git a/tests/contracts/passing_contracts/use_iface.vy b/tests/contracts/passing_contracts/use_iface.vy index b29c6ff..c2903df 100644 --- a/tests/contracts/passing_contracts/use_iface.vy +++ b/tests/contracts/passing_contracts/use_iface.vy @@ -10,7 +10,7 @@ import exampledependency.Dependency as Dep from .interfaces import IFace2 as IFace2 # Also use IFaceNested to show we can use nested interfaces. -from contracts.passing_contracts.interfaces.nested import IFaceNested as IFaceNested +from tests.contracts.passing_contracts.interfaces.nested import IFaceNested as IFaceNested @external