Introduce test.test_support.TransientResource. It's a context manager to
commitae3c150d2bcebf2e54d5b67a41d247b483599e36
authorbrett.cannon <brett.cannon@6015fed2-1504-0410-9fe1-9d1591cc4771>
Thu, 8 Mar 2007 23:58:11 +0000 (8 23:58 +0000)
committerbrett.cannon <brett.cannon@6015fed2-1504-0410-9fe1-9d1591cc4771>
Thu, 8 Mar 2007 23:58:11 +0000 (8 23:58 +0000)
treee03122034e7e69d1e4afc3b55fa794933a9c044b
parentd938f7fc9baa9831edf534394082f44f599c9dc1
Introduce test.test_support.TransientResource.  It's a context manager to
surround calls to resources that may or may not be available.  Specifying the
expected exception and attributes to be raised if the resource is not available
prevents overly broad catching of exceptions.

This is meant to help suppress spurious failures by raising
test.test_support.ResourceDenied if the exception matches.  It would probably
be good to go through the various network tests and surround the calls to catch
connection timeouts (as done with test_socket_ssl in this commit).

git-svn-id: http://svn.python.org/projects/python/trunk@54233 6015fed2-1504-0410-9fe1-9d1591cc4771
Doc/lib/libtest.tex
Lib/test/test_socket_ssl.py
Lib/test/test_support.py
Misc/NEWS