Open fubuloubu opened 5 years ago
Suggestion would be:
conftest.py
:
@pytest.fixture
def package(vy_deployer):
return Package(
'path/to/contractA.vy,
'path/to/contractB.vy,
...,
'path/to/contractZ.vy,
) # Compile now!
test_contractA.py
:
@pytest.fixture
def contract(package):
return package.deploy('contractA', *args) # Wishlist: this just returns the instance!
:+1:
*
style declarations which do the auto-finding thing)
What was wrong?
I have a contract I am working on, so it doesn't compile yet. I don't have a test for it either, but my test suite is unable to work if this contract exists. At most, it could issue a warning about untested contracts in directory if the worry is not testing everything
How can it be fixed?
If compilation was "lazy" (aka only compiled when needed to deploy), I would avoid this problem because it would never compile contracts I don't care about.
If the problem is that you need to know what is in the manifest first, then I would suggest you allow us to specify what gets put into the manifest for testing purposes into a
confest.py
. This might be helpful for additional testing fixtures we may have in the local directory as well. This would make sense to me to do within stage 1 of the 2 stage deployment process: