hiroaki-yamamoto / mongoengine-goodjson

More human-readable json serializer/deserializer for MongoEngine
MIT License
62 stars 19 forks source link

Deprecation Warning When Executing Alongside Pytest #264

Open jusexton opened 4 years ago

jusexton commented 4 years ago

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

tirkarthi commented 4 years ago

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

jusexton commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

It seems these were removed in https://github.com/hiroaki-yamamoto/mongoengine-goodjson/commit/56d30c271141ce9619ceae2857367b71d34accea

jusexton commented 4 years ago

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

jusexton commented 3 years ago

Any updates on this?

vitaliimelnychuk commented 3 years ago

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