While writing unit test i noticed this warning is displayed
...unittest/case.py:615: ResourceWarning: unclosed <ssl.SSLSocket fd=7, ...
This is due to the creation of a requests.Session() and not closing it. Although this is a warning, it would be nice to handle this with a context manager..
Something like:
with JustWatch(...) as j:
results = j.search_for_item(...)
This would require handing creation and deletion of Session() in __enter__ and __exit__ respectively
While writing unit test i noticed this warning is displayed
...unittest/case.py:615: ResourceWarning: unclosed <ssl.SSLSocket fd=7, ...
This is due to the creation of a requests.Session() and not closing it. Although this is a warning, it would be nice to handle this with a context manager..
Something like:
This would require handing creation and deletion of Session() in
__enter__
and__exit__
respectively@draogn thoughts?