ResourceWarning: unclosed event loop on macOS, within pytest
See original GitHub issueI just updated command line tools and macOS to 10.15.4
, I’m within a virtualenv, using ipdb
within pytest
, Python v. 3.7.7. Don’t know if the update is related.
I’m getting the following error:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 622, in __del__
source=self)
ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
Exception ignored in: <socket.socket fd=8, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
ResourceWarning: unclosed <socket.socket fd=8, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <socket.socket fd=9, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
ResourceWarning: unclosed <socket.socket fd=9, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <function BaseEventLoop.__del__ at 0x11b5d73b0>
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 622, in __del__
source=self)
ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
Exception ignored in: <socket.socket fd=32, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
ResourceWarning: unclosed <socket.socket fd=32, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <socket.socket fd=33, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
ResourceWarning: unclosed <socket.socket fd=33, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <function BaseEventLoop.__del__ at 0x11b5d73b0>
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/asyncio/base_events.py", line 622, in __del__
source=self)
ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
Exception ignored in: <socket.socket fd=46, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
ResourceWarning: unclosed <socket.socket fd=46, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <socket.socket fd=47, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
ResourceWarning: unclosed <socket.socket fd=47, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>
Exception ignored in: <function BaseEventLoop.__del__ at 0x11b5d73b0>
Traceback (most recent call last):
Randomly in the ipdb
prompt.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:12 (3 by maintainers)
Top Results From Across the Web
debugging python code while doing unitest using ipdb ...
... ResourceWarning: unclosed event loop <_UnixSelectorEventLoop ... I'm having this issue on osx. upgraded my python to 3.8.1 and am still ...
Read more >pytest Documentation - Read the Docs
The first test passed and the second failed. You can easily see the intermediate values in the assertion to help you under-.
Read more >Testing with AnyIO — AnyIO 3.6.2 documentation
The test runner keeps an event loop open during the request, making it possible for code in fixtures to communicate with the code...
Read more >Changelog — pytest documentation
Backward incompatible (breaking) changes will only be introduced in major versions with advance notice in the Deprecations section of releases. pytest 7.1.3 ( ......
Read more >no running event loop sys:1: runtimewarning: coroutine 'loop ...
Asyncio in corroutine RuntimeError: no running event loop ... Open side panel ... ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Any updates on this problem? There are too many noisy warnings during debugging. Or any method to suppress these warnings temporarily?
Just to verify, I can reproduce the issue as well, at the same line in prompt_toolkit’s application.py:808. Is there any quickfix to just suppress the warning for now? It’s really hindering to the debugging process due to all the noise.