Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test files not unique in brownie v1.14.5 #180

Open
rpopplewell opened this issue Aug 18, 2023 · 0 comments
Open

Test files not unique in brownie v1.14.5 #180

rpopplewell opened this issue Aug 18, 2023 · 0 comments

Comments

@rpopplewell
Copy link

What was wrong?

When runningbrownie test I get the following output:

Brownie v1.14.5 - Python development framework for Ethereum

================================================ test session starts ================================================
platform darwin -- Python 3.8.17, pytest-6.0.1, py-1.10.0, pluggy-0.13.1
rootdir: /Users/chris/github.com/curve-contract
plugins: eth-brownie-1.14.5, hypothesis-5.41.3, xdist-1.34.0, web3-5.11.1, forked-1.3.0
collected 14564 items / 2 errors / 14562 selected

Launching 'ganache-cli --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic brownie --defaultBalanceEther 10000'...

====================================================== ERRORS =======================================================
_____________________________ ERROR collecting tests/pools/eth/test_exchange_reverts.py _____________________________
import file mismatch:
imported module 'test_exchange_reverts' has this __file__ attribute:
  /Users/chris/github.com/curve-contract/tests/pools/common/unitary/test_exchange_reverts.py
which is not the same as the test file we want to collect:
  /Users/chris/github.com/curve-contract/tests/pools/eth/test_exchange_reverts.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
________________ ERROR collecting tests/zaps/meta/integration/test_remove_liquidity_imbalance_zap.py ________________
import file mismatch:
imported module 'test_remove_liquidity_imbalance_zap' has this __file__ attribute:
  /Users/chris/github.com/curve-contract/tests/zaps/common/test_remove_liquidity_imbalance_zap.py
which is not the same as the test file we want to collect:
  /Users/chris/github.com/curve-contract/tests/zaps/meta/integration/test_remove_liquidity_imbalance_zap.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules

How can it be fixed?

I fixed this by changing the names of the files to test_remove_liquidity_imbalance_common.py, test_remove_liquidity_imbalance_meta.py, etc.

Also when compiling I had this common issue with pyyaml as detailed in yaml/pyyaml#724
Which was solved with running pip install wheel pyyaml==5.4.1 cython==0.29.36 --no-build-isolation in the venv prior to installing dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant