summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-01-04 00:23:49 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-01-04 00:23:49 (GMT)
commit92d54d5e9c52da3eb71b4a5aa940d0f2b6aed254 (patch)
tree76c26b8b036b4b06c0140c01e24f1a5a334afdd4 /Doc
parent5399910eba1ef3580aebf49482b1367f14fa6c48 (diff)
downloadcpython-92d54d5e9c52da3eb71b4a5aa940d0f2b6aed254.zip
cpython-92d54d5e9c52da3eb71b4a5aa940d0f2b6aed254.tar.gz
cpython-92d54d5e9c52da3eb71b4a5aa940d0f2b6aed254.tar.bz2
Add EnvironmentVarGuard to test.test_support. Provides a context manager to
temporarily set or unset environment variables.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libtest.tex18
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/lib/libtest.tex b/Doc/lib/libtest.tex
index 811d2f7..f89c707 100644
--- a/Doc/lib/libtest.tex
+++ b/Doc/lib/libtest.tex
@@ -281,4 +281,22 @@ Execute the \class{unittest.TestSuite} instance \var{suite}.
The optional argument \var{testclass} accepts one of the test classes in the
suite so as to print out more detailed information on where the testing suite
originated from.
+
+The \module{test.test_support} module defines the following classes:
+
+\begin{classdesc}{EnvironmentVarGuard}{}
+Class used to temporarily set or unset environment variables. Instances can be
+used as a context manager.
+\versionadded{2.6}
+\end{classdesc}
+
+\begin{methoddesc}{set}{envvar, value}
+Temporarily set the environment variable \code{envvar} to the value of
+\code{value}.
+\end{methoddesc}
+
+\begin{methoddesc}{unset}{envvar}
+Temporarily unset the environment variable \code{envvar}.
+\end{methoddesc}
+
\end{funcdesc}