aleph-im / aleph-sdk-python

Python SDK library for the Aleph.im network
MIT License
3 stars 5 forks source link

Multiple warnings in the tests #152

Closed hoh closed 2 months ago

hoh commented 2 months ago
=============================== warnings summary ===============================
../../../.local/share/hatch/env/virtual/aleph-sdk-python/dpGOC7fc/testing/lib/python3.9/site-packages/eth_utils/network.py:44
  /home/runner/.local/share/hatch/env/virtual/aleph-sdk-python/dpGOC7fc/testing/lib/python3.9/site-packages/eth_utils/network.py:44: UserWarning: Network 345 with name 'Yooldo Verse Mainnet' does not have a valid ChainId. eth-typing should be updated with the latest networks.
    warnings.warn(

../../../.local/share/hatch/env/virtual/aleph-sdk-python/dpGOC7fc/testing/lib/python3.9/site-packages/eth_utils/network.py:44
  /home/runner/.local/share/hatch/env/virtual/aleph-sdk-python/dpGOC7fc/testing/lib/python3.9/site-packages/eth_utils/network.py:44: UserWarning: Network 12611 with name 'Astar zkEVM' does not have a valid ChainId. eth-typing should be updated with the latest networks.
    warnings.warn(

tests/unit/test_asynchronous.py::test_create_store
  /home/runner/work/aleph-sdk-python/aleph-sdk-python/src/aleph/sdk/client/authenticated_http.py:684: RuntimeWarning: coroutine 'MockResponse.raise_for_status' was never awaited
    resp.raise_for_status()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/unit/test_chain_ethereum.py::test_decrypt_secp256k1
  /home/runner/work/aleph-sdk-python/aleph-sdk-python/tests/unit/test_chain_ethereum.py:121: DeprecationWarning: This method will be moved to its own module `aleph.sdk.encryption`
    encrypted = await account.encrypt(content)

tests/unit/test_chain_ethereum.py::test_decrypt_secp256k1
  /home/runner/work/aleph-sdk-python/aleph-sdk-python/tests/unit/test_chain_ethereum.py:123: DeprecationWarning: This method will be moved to its own module `aleph.sdk.encryption`
    decrypted = await account.decrypt(encrypted)

tests/unit/test_remote_account.py::test_remote_storage
  /home/runner/work/aleph-sdk-python/aleph-sdk-python/src/aleph/sdk/chains/remote.py:55: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    response.raise_for_status()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/unit/test_remote_account.py::test_remote_storage
  /home/runner/work/aleph-sdk-python/aleph-sdk-python/src/aleph/sdk/chains/remote.py:78: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    response.raise_for_status()
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

tests/unit/test_remote_account.py::test_remote_storage
  /home/runner/.local/share/hatch/env/virtual/aleph-sdk-python/dpGOC7fc/testing/lib/python3.9/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning: Exception ignored in: <function RemoteAccount.__del__ at 0x7f2be17a0dc0>

  Traceback (most recent call last):
    File "/home/runner/work/aleph-sdk-python/aleph-sdk-python/src/aleph/sdk/chains/remote.py", line 69, in __del__
      asyncio.get_running_loop().create_task(self._session.close())
    File "/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/asyncio/base_events.py", line 438, in create_task
      task = tasks.Task(coro, loop=self, name=name)
  TypeError: a coroutine was expected, got <MagicMock name='ClientSession.close()' id='139826418007296'>

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================ 108 passed, 1 deselected, 8 warnings in 5.32s =================
philogicae commented 2 months ago

Fine after:

pip install -e . --force