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

Fix #10 - test rinkeby #96

Merged
merged 22 commits into from
May 30, 2022
Merged

Fix #10 - test rinkeby #96

merged 22 commits into from
May 30, 2022

Conversation

trentmc
Copy link
Member

@trentmc trentmc commented May 28, 2022

Fixes #10.

@trentmc trentmc self-assigned this May 28, 2022
@trentmc trentmc marked this pull request as draft May 28, 2022 04:54
@trentmc
Copy link
Member Author

trentmc commented May 28, 2022

Current problem:

(venv) trentmc@trentmcLnv:~/code/df-py$ brownie test util/test/test_rinkeby.py::test_main
Brownie v1.18.2 - Python development framework for Ethereum

======================================================== test session starts =========================================================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/trentmc/code/df-py
plugins: eth-brownie-1.18.2, xdist-1.34.0, hypothesis-6.27.3, web3-5.29.0, forked-1.4.0
collected 1 item                                                                                                                     
Attached to local RPC client listening at '127.0.0.1:8545'...

util/test/test_rinkeby.py F                                                                                                    [100%]

============================================================== FAILURES ==============================================================
_____________________________________________________________ test_main ______________________________________________________________

    @enforce_types
    def test_main():
        #setup_function
        networkutil.connect(CHAINID)
        address_file = networkutil.chainIdToAddressFile(CHAINID)
        oceanutil.recordDeployedContracts(address_file)
    
        #main
        assert brownie.network.chain.id == CHAINID
    
        query = "{ opcs{approvedTokens} }"
        result = submitQuery(query, CHAINID)
    
        OCEAN = oceanutil.OCEANtoken()
        assert OCEAN.symbol() == "OCEAN"
    
        #teardown_function
>       networkutil.disconnect()

util/test/test_rinkeby.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def disconnect():
        network = brownie.network
        if not network.is_connected():
            return
    
        chainID = network.chain.id
        if chainID in CONTRACTS:
            del CONTRACTS[chainID]
    
>       network.disconnect()
E       KeyError: '0x8967BCF84170c91B0d24D4302C2376283b0B3a07'

util/networkutil.py:79: KeyError
========================================================== warnings summary ==========================================================
venv/lib/python3.8/site-packages/brownie/network/main.py:44
  /home/trentmc/code/df-py/venv/lib/python3.8/site-packages/brownie/network/main.py:44: BrownieEnvironmentWarning: Development network has a block height of 3733
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================================================== short test summary info =======================================================
FAILED util/test/test_rinkeby.py::test_main - KeyError: '0x8967BCF84170c91B0d24D4302C2376283b0B3a07'
==================================================== 1 failed, 1 warning in 8.34s ====================================================
  File "brownie/_cli/__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "brownie/_cli/test.py", line 61, in main
    return_code = pytest.main(pytest_args, ["pytest-brownie"])
  File "_pytest/config/__init__.py", line 162, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "_pytest/main.py", line 316, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "_pytest/main.py", line 311, in wrap_session
    config._ensure_unconfigure()
  File "_pytest/config/__init__.py", line 987, in _ensure_unconfigure
    self.hook.pytest_unconfigure(config=self)
  File "pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "brownie/test/managers/base.py", line 267, in pytest_unconfigure
    project.close(raises=False)
  File "brownie/project/main.py", line 482, in close
    _remove_contract(contract)
  File "brownie/network/state.py", line 587, in _remove_contract
    del _contract_map[contract.address]
KeyError: '0x8967BCF84170c91B0d24D4302C2376283b0B3a07'

@trentmc
Copy link
Member Author

trentmc commented May 28, 2022

Re my curent problem:

@trentmc trentmc marked this pull request as ready for review May 30, 2022 16:34
@trentmc trentmc merged commit 8495967 into main May 30, 2022
@trentmc trentmc deleted the issue10-rinkeby2 branch May 30, 2022 16:36
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

Successfully merging this pull request may close these issues.

Ensure df-py works on rinkeby
1 participant