Skip to content

Pytest problem Lesson 7 #315

Answered by ZeroEkkusu
Cesarioo asked this question in Q&A
Nov 5, 2021 · 2 comments · 8 replies
Discussion options

You must be logged in to vote

So, the issue is with the GUI Ganache. I've found a few similar issues reported on the repo, as well. Until it gets fixed (or we find what we're doing wrong 😉), you can do

ex = ValueError if network.show_active(
) == "ganache-local" else exceptions.VirtualMachineError
with pytest.raises(ex):
        # ...

Another solution is

with pytest.raises(exceptions.VirtualMachineError):
    lottery.enter(
        {"from": get_account(), "value": lottery.getEntranceFee(), "gas_limit": 100000, "allow_revert": True})

As for the testing times, this is what I get in Lesson 7:
brownie test --network development 00:05
brownie test --network ganache-local 00:08
Testing on an actual testnet takes much longer…

Replies: 2 comments 8 replies

Comment options

You must be logged in to vote
7 replies
@PatrickAlphaC
Comment options

@ZeroEkkusu
Comment options

@cromewar
Comment options

@Cesarioo
Comment options

@Cesarioo
Comment options

Comment options

You must be logged in to vote
1 reply
@cromewar
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants