Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging python code while doing unitest using ipdb ResourceWarning

I have a python code that workes well on Ubuntu 16. I installed Ubuntu 18 and now when I try to debug the code while doing unitest I get the following warning each time I press 'n' or 's':

ipdb> /usr/lib/python3.7/asyncio/base_events.py:618: ResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>
  source=self)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

I use python 3.7.5

How do I get rid of this warning? Its impossible to work like that

like image 485
Yonatan Faigenbaum Avatar asked Mar 05 '20 14:03

Yonatan Faigenbaum


1 Answers

Running with python -W ignore script.py worked to get rid of this while debugging.

like image 145
rado Avatar answered Oct 18 '22 00:10

rado