[issue26612] test_ssl: use context manager (with) to fix ResourceWarning

Martin Panter report at bugs.python.org
Tue Mar 22 21:52:26 EDT 2016


Martin Panter added the comment:

Wouldn’t it be better to fix the underlying problem with the test cases? As I understand it, that would also avoid the warnings :)

Also, you can often use self.addCleanup(s.close), which saves a level of indentation (and associated noise in the annotate history). I used this technique in my remaining patch for Issue 25940.

----------
nosy: +martin.panter

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26612>
_______________________________________


More information about the Python-bugs-list mailing list