brownie icon indicating copy to clipboard operation
brownie copied to clipboard

Coverage does not work

Open vsmelov opened this issue 2 years ago • 0 comments

Environment information

  • brownie Version: v1.19.1
  • ganache-cli Version: Ganache CLI v6.12.2 (ganache-core: 2.13.2)
  • solc Version: 0.8.17 (BUT I also checked with 0.8.6)
  • Python Version: 3.9.9
  • OS: osx (MacBook air M1)

What was wrong?

Tests were passed, but no coverage was generated

  • what command you ran
git clone https://github.com/FirstApproval/first-approval-contracts.git tmp
cd tmp
git checkout 37897e9e661ca5ac0ffd3a2cabb4dafc8e34a784
brownie test --coverage
  • the code that caused the failure

my correct contract - https://github.com/FirstApproval/first-approval-contracts/blob/37897e9e661ca5ac0ffd3a2cabb4dafc8e34a784/contracts/FirstApproval.sol

  • full output of the error you received
vladimirsmelov@Vladimirs-MacBook-Air tmp % brownie test --coverage
Brownie v1.19.1 - Python development framework for Ethereum

===================================================================================== test session starts =====================================================================================
platform darwin -- Python 3.9.9, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /Users/vladimirsmelov/PycharmProjects/tmp
plugins: eth-brownie-1.19.1, forked-1.4.0, web3-5.30.0, xdist-1.34.0, hypothesis-6.27.3
collected 4 items                                                                                                                                                                             

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

tests/test_first_approval.py ....                                                                                                                                                       [100%]

====================================================================================== warnings summary =======================================================================================
tests/test_first_approval.py: 38 warnings
  /Users/vladimirsmelov/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/eth_abi/codec.py:87: DeprecationWarning: abi.encode_abi() and abi.encode_abi_packed() are deprecated and will be removed in version 4.0.0 in favor of abi.encode() and abi.encode_packed(), respectively
    warnings.warn(

tests/test_first_approval.py: 14 warnings
  /Users/vladimirsmelov/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/eth_abi/codec.py:191: DeprecationWarning: abi.decode_abi() is deprecated and will be removed in version 4.0.0 in favor of abi.decode()
    warnings.warn(

tests/test_first_approval.py::test_set_settings
tests/test_first_approval.py::test_transfer_with_fee
tests/test_first_approval.py::test_transfer_with_fee
tests/test_first_approval.py::test_transfer_with_fee
tests/test_first_approval.py::test_transfer_with_fee
tests/test_first_approval.py::test_transfer_with_fee
tests/test_first_approval.py::test_transfer_with_fee
  /Users/vladimirsmelov/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/eth_abi/codec.py:164: DeprecationWarning: abi.decode_single() is deprecated and will be removed in version 4.0.0 in favor of abi.decode()
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================================== Coverage ===========================================================================================

Coverage report saved at /Users/vladimirsmelov/PycharmProjects/tmp/reports/coverage.json
View the report using the Brownie GUI
=============================================================================== 4 passed, 59 warnings in 3.86s ================================================================================
Terminating local RPC client...

ALSO - when I run

brownie gui

it does not show me GUI coverage

How can it be fixed?

I don't know.

vsmelov avatar Dec 09 '22 10:12 vsmelov