Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Deprecation Warning When Executing Alongside Pytest #264

Open
jusexton opened this issue Aug 25, 2020 · 7 comments
Open

Deprecation Warning When Executing Alongside Pytest #264

jusexton opened this issue Aug 25, 2020 · 7 comments

Comments

@jusexton
Copy link

Describe the bug
When importing mongoengine-goodjson or a module that consumes mongoengine-goodjson into a pytest script, a deprecation warning is raised.

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 @encode.register(collections.Iterable)

To Reproduce

  1. import mongoengine-goodjson into the same file pytest test cases will be executed
  2. run tests with pytest.
  3. Deprecation warning will be displayed

Expected behavior
No deprecation warning should be displayed.

Additional context

  • It does not appear mongoengine-goodjson will be compatible with python 3.9 unless this issue is resolved.
  • I would love to raise a fix for this but its not clear how the encoder and decoder are being generated.
@tirkarthi
Copy link

Can you please attach the full warning log? This could be from a third party project or dependency.

@jusexton
Copy link
Author

Below is the full log displayed in the console:

venv/lib/python3.8/site-packages/mongoengine_goodjson/encoder.py:151: 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 @encode.register(collections.Iterable)

If there is a method of producing more verbose logs, let me know.

@bebetoalves
Copy link

Same with me:

/home/bebeto/Projects/api-collector/venv/lib/python3.8/site-packages/mongoengine_goodjson/encoder.py:151: 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
  @encode.register(collections.Iterable)
/home/bebeto/Projects/api-collector/venv/lib/python3.8/site-packages/mongoengine/queryset/base.py:399: DeprecationWarning: count is deprecated. Use Collection.count_documents instead.
  count = self._cursor.count(with_limit_and_skip=with_limit_and_skip)

@tirkarthi
Copy link

It seems these were removed in 56d30c2

@jusexton
Copy link
Author

jusexton commented Oct 22, 2020

I am using version 1.1.8. Looks like 56d30c2 just barely missed the 1.1.8 release. This issue should be fixed in the next release.

@jusexton
Copy link
Author

Any updates on this?

@vitaliimelnychuk
Copy link

The same for me, is there is anything I can help with to fix this issue?

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

No branches or pull requests

4 participants