TheTelematic / plytix-pim-client

An HTTP client in Python for Plytix PIM API.
MIT License
1 stars 0 forks source link

Try to fix warning in tests #29

Open TheTelematic opened 6 days ago

TheTelematic commented 6 days ago
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"
TheTelematic commented 2 days ago

Also, I have a custom fixture of event_loop, which is necessary otherwise the tests fail due to there are some async tasks terminated before they should, but pytest-asyncio complains about the custom fixture.

TheTelematic commented 1 day ago

The first warning is solved in #10 , but it still this warning related to my previous comment:

DeprecationWarning: The event_loop fixture provided by pytest-asyncio has been redefined in
  /Users/arturo/PycharmProjects/plytix-pim-client/tests/conftest.py:13
  Replacing the event_loop fixture with a custom implementation is deprecated
  and will lead to errors in the future.
  If you want to request an asyncio event loop with a scope other than function
  scope, use the "scope" argument to the asyncio mark when marking the tests.
  If you want to return different types of event loops, use the event_loop_policy
  fixture.