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

40+ pytest warnings add friction to testing #157

Closed
trentmc opened this issue Feb 24, 2021 · 3 comments · Fixed by #158
Closed

40+ pytest warnings add friction to testing #157

trentmc opened this issue Feb 24, 2021 · 3 comments · Fixed by #158
Assignees
Labels
Type: Enhancement New feature or request

Comments

@trentmc
Copy link
Member

trentmc commented Feb 24, 2021

Is your feature request related to a problem? Please describe.
When I go to run even a single unit test, I get 40 warnings, all deprecation warnings. (Examples below). It makes it really hard to wade through to get to what actually matters - the errors, and non-deprecation warnings.

The warnings are for 3rd party packages related to python3.8. Not really in our control, and they'll get better on their own in the next 6-12 months anyway.

Describe the solution you'd like
Explicitly disable just specific warnings of these 3rd party packages for py 3.8. Other warnings should be kept on (good hygiene).

Example warnings

(venv) trentmc@trentmcLnv:~/code/ocean.py$ pytest tests/models/test_btoken.py
=========================================================== test session starts ============================================================
platform linux -- Python 3.8.7, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/trentmc/code/ocean.py, configfile: setup.cfg
collected 1 item                                                                                                                           

tests/models/test_btoken.py .                                                                                                        [100%]

============================================================= warnings summary =============================================================
venv/lib/python3.8/site-packages/eth_account/account.py:1
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/eth_account/account.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    from collections import (

venv/lib/python3.8/site-packages/cytoolz/compatibility.py:2
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/cytoolz/compatibility.py:2: DeprecationWarning: The toolz.compatibility module is no longer needed in Python 3 and has been deprecated. Please import these utilities directly from the standard library. This module will be removed in a future release.
    warnings.warn("The toolz.compatibility module is no longer "

venv/lib/python3.8/site-packages/eth_keys/datatypes.py:28
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/eth_keys/datatypes.py:28: DeprecationWarning: The eth_utils.typing module will be deprecated in favor of eth-typing in the next major version bump.
    from eth_utils.typing import (

venv/lib/python3.8/site-packages/attrdict/mixins.py:5
venv/lib/python3.8/site-packages/attrdict/mixins.py:5
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/attrdict/mixins.py:5: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    from collections import Mapping, MutableMapping, Sequence

venv/lib/python3.8/site-packages/web3/utils/formatters.py:1
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/web3/utils/formatters.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    from collections import (

venv/lib/python3.8/site-packages/web3/datastructures.py:1
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/web3/datastructures.py:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    from collections import (

venv/lib/python3.8/site-packages/web3/utils/six/six.py:7
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/web3/utils/six/six.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    Generator = collections.Generator

venv/lib/python3.8/site-packages/eth_utils/applicators.py:28
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/eth_utils/applicators.py:28: DeprecationWarning: combine_argument_formatters(formatter1, formatter2)([item1, item2])has been deprecated and will be removed in a subsequent major version release of the eth-utils library. Update your calls to use apply_formatters_to_sequence([formatter1, formatter2], [item1, item2]) instead.
    warnings.warn(

venv/lib/python3.8/site-packages/websockets/framing.py:77
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/framing.py:77: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read(cls, reader, *, mask, max_size=None, extensions=None):

venv/lib/python3.8/site-packages/websockets/http.py:54
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/http.py:54: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_request(stream):

venv/lib/python3.8/site-packages/websockets/http.py:99
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/http.py:99: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_response(stream):

venv/lib/python3.8/site-packages/websockets/http.py:143
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/http.py:143: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_headers(stream):

venv/lib/python3.8/site-packages/websockets/http.py:183
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/http.py:183: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_line(stream):

venv/lib/python3.8/site-packages/websockets/protocol.py:300
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:300: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def recv(self):

venv/lib/python3.8/site-packages/websockets/protocol.py:353
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:353: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def send(self, data):

venv/lib/python3.8/site-packages/websockets/protocol.py:374
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:374: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def close(self, code=1000, reason=''):

venv/lib/python3.8/site-packages/websockets/protocol.py:422
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:422: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def ping(self, data=None):

venv/lib/python3.8/site-packages/websockets/protocol.py:461
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:461: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def pong(self, data=b''):

venv/lib/python3.8/site-packages/websockets/protocol.py:481
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:481: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def ensure_open(self):

venv/lib/python3.8/site-packages/websockets/protocol.py:519
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:519: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def transfer_data(self):

venv/lib/python3.8/site-packages/websockets/protocol.py:571
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:571: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_message(self):

venv/lib/python3.8/site-packages/websockets/protocol.py:634
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:634: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_data_frame(self, max_size):

venv/lib/python3.8/site-packages/websockets/protocol.py:701
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:701: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_frame(self, max_size):

venv/lib/python3.8/site-packages/websockets/protocol.py:716
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:716: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def write_frame(self, opcode, data=b'', _expected_state=State.OPEN):

venv/lib/python3.8/site-packages/websockets/protocol.py:770
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:770: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def write_close_frame(self, data=b''):

venv/lib/python3.8/site-packages/websockets/protocol.py:789
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:789: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def close_connection(self):

venv/lib/python3.8/site-packages/websockets/protocol.py:869
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/protocol.py:869: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait_for_connection_lost(self):

venv/lib/python3.8/site-packages/websockets/client.py:48
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/client.py:48: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def write_http_request(self, path, headers):

venv/lib/python3.8/site-packages/websockets/client.py:64
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/client.py:64: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_http_response(self):

venv/lib/python3.8/site-packages/websockets/client.py:195
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/client.py:195: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def handshake(self, wsuri, origin=None, available_extensions=None,

venv/lib/python3.8/site-packages/websockets/client.py:388
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/client.py:388: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def __iter__(self):                                     # pragma: no cover

venv/lib/python3.8/site-packages/websockets/server.py:74
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:74: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def handler(self):

venv/lib/python3.8/site-packages/websockets/server.py:199
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:199: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def read_http_request(self):

venv/lib/python3.8/site-packages/websockets/server.py:222
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:222: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def write_http_response(self, status, headers, body=None):

venv/lib/python3.8/site-packages/websockets/server.py:243
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:243: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def process_request(self, path, request_headers):

venv/lib/python3.8/site-packages/websockets/server.py:420
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:420: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def handshake(self, origins=None, available_extensions=None,

venv/lib/python3.8/site-packages/websockets/server.py:580
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:580: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def wait_closed(self):

venv/lib/python3.8/site-packages/websockets/server.py:744
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/websockets/server.py:744: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def __iter__(self):                                     # pragma: no cover

venv/lib/python3.8/site-packages/_pytest/config/__init__.py:1233
  /home/trentmc/code/ocean.py/venv/lib/python3.8/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: collect_ignore
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/warnings.html
====================================================== 1 passed, 40 warnings in 2.67s ======================================================
(venv) trentmc@trentmcLnv:~/code/ocean.py$ 
@trentmc trentmc added the Type: Enhancement New feature or request label Feb 24, 2021
@trentmc trentmc self-assigned this Feb 24, 2021
trentmc added a commit that referenced this issue Feb 24, 2021
trentmc added a commit that referenced this issue Feb 24, 2021
@trentmc
Copy link
Member Author

trentmc commented Feb 24, 2021

I realized that I shouldn't have closed until I have tested that it's working without needing the --with-provider2 flag when running barge; or unless we've updated documentation and user expectations accordingly.

So, reopening. I'm running the test now. Will update when done.

@trentmc trentmc reopened this Feb 24, 2021
@kremalicious
Copy link
Contributor

kremalicious commented Feb 24, 2021

I'm also confused about that new --with-provider2. It seems both libraries have this now set in Travis since yesterday. If this flag is required to run anything successful against barge, it should be a default over there

@trentmc
Copy link
Member Author

trentmc commented Feb 25, 2021

I'm also confused about that new --with-provider2. It seems both libraries have this now set in Travis since yesterday. If this flag is required to run anything successful against barge, it should be a default over there

Agreed.

I just realized that since that's a different issue than this issue, I created a new issue. #166

So now we can close this issue.

@trentmc trentmc closed this as completed Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants