]> granicus.if.org Git - python/commit
Closes #26620: Fix ResourceWarning in test_urllib2_localnet
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 24 Mar 2016 12:55:58 +0000 (13:55 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 24 Mar 2016 12:55:58 +0000 (13:55 +0100)
commitbc6b72ed06318a80a68b4bbf513a0e055b102e11
tree0df641245428f706ff77cb9d5ce38834e74d0d89
parente321274b2eeaf9cfaccbc8d40c4056ab72040e1b
Closes #26620: Fix ResourceWarning in test_urllib2_localnet

* Use context manager on urllib objects to ensure that they are closed on error
* Use self.addCleanup() to cleanup resources even if a test is interrupted
  with CTRL+c
Lib/test/test_urllib2_localnet.py