Open jaxxstorm opened 1 year ago
I'm curious to take a look at how pervasive the use of ensure_future
is. From reading the docs:
Deprecated since version 3.10: Deprecation warning is emitted if obj is not a Future-like object and loop is not specified and there is no running event loop.
It sounds like ensure_future
isn't totally deprecated, but only if you're not using it as intended. That's how I'm reading it, at least.
What happened?
When writing unit tests with
pytest
, there are lots of deprecation warnings:This seems related to the usage
asyncio.ensure_future
which is deprecated:https://docs.python.org/3/library/asyncio-future.html#asyncio.ensure_future
Steps to reproduce
Write a standard unit test for a python component run
pytest
Expected Behavior
Only errors related to the test are thrown
Actual Behavior
You get a whole load of deprecation warnings
Output of
pulumi about
No response
Additional context
You can suppress this by doing
python -m pytest --disable-pytest-warnings
but we should still remove use of a deprecated methodContributing
Vote on this issue by adding a š reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).