merge with last upstream doc changes in 3.2

This commit is contained in:
Georg Brandl 2013-03-28 08:57:50 +01:00
commit f5390fc162
3 changed files with 18 additions and 13 deletions

View File

@ -663,7 +663,7 @@ the test unless the passed object has a certain attribute::
def skipUnlessHasattr(obj, attr):
if hasattr(obj, attr):
return lambda func: func
return unittest.skip("{0!r} doesn't have {1!r}".format(obj, attr))
return unittest.skip("{!r} doesn't have {!r}".format(obj, attr))
The following decorators implement test skipping and expected failures:
@ -685,6 +685,13 @@ The following decorators implement test skipping and expected failures:
Mark the test as an expected failure. If the test fails when run, the test
is not counted as a failure.
.. exception:: SkipTest(reason)
This exception is raised to skip a test.
Usually you can use :meth:`TestCase.skipTest` or one of the skipping
decorators instead of raising this directly.
Skipped tests will not have :meth:`setUp` or :meth:`tearDown` run around them.
Skipped classes will not have :meth:`setUpClass` or :meth:`tearDownClass` run.
@ -2105,7 +2112,7 @@ then you must call up to them yourself. The implementations in
If an exception is raised during a ``setUpClass`` then the tests in the class
are not run and the ``tearDownClass`` is not run. Skipped classes will not
have ``setUpClass`` or ``tearDownClass`` run. If the exception is a
``SkipTest`` exception then the class will be reported as having been skipped
:exc:`SkipTest` exception then the class will be reported as having been skipped
instead of as an error.
@ -2122,7 +2129,7 @@ These should be implemented as functions::
If an exception is raised in a ``setUpModule`` then none of the tests in the
module will be run and the ``tearDownModule`` will not be run. If the exception is a
``SkipTest`` exception then the module will be reported as having been skipped
:exc:`SkipTest` exception then the module will be reported as having been skipped
instead of as an error.

View File

@ -88,8 +88,8 @@ library/repr,,`,"return `obj`"
library/smtplib,,:port,"as well as a regular host:port server."
library/socket,,::,'5aef:2b::8'
library/sqlite3,,:memory,
library/sqlite3,,:age,"select name_last, age from people where name_last=:who and age=:age"
library/sqlite3,,:who,"select name_last, age from people where name_last=:who and age=:age"
library/sqlite3,,:who,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"
library/sqlite3,,:age,"cur.execute(""select * from people where name_last=:who and age=:age"", {""who"": who, ""age"": age})"
library/ssl,,:My,"Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc."
library/ssl,,:My,"Organizational Unit Name (eg, section) []:My Group"
library/ssl,,:myserver,"Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com"
@ -112,9 +112,9 @@ library/turtle,,::,Example::
library/urllib,,:port,:port
library/urllib2,,:password,"""joe:password@python.org"""
library/uuid,,:uuid,urn:uuid:12345678-1234-5678-1234-567812345678
library/xmlrpclib,,:pass,http://user:pass@host:port/path
library/xmlrpclib,,:pass,user:pass
library/xmlrpclib,,:port,http://user:pass@host:port/path
library/xmlrpc.client,,:pass,http://user:pass@host:port/path
library/xmlrpc.client,,:port,http://user:pass@host:port/path
library/xmlrpc.client,,:pass,user:pass
license,,`,THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
license,,:zooko,mailto:zooko@zooko.com
license,,`,THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
@ -173,7 +173,8 @@ faq/windows,,:EOF,@setlocal enableextensions & python -x %~f0 %* & goto :EOF
faq/windows,,:REG,.py :REG_SZ: c:\<path to python>\python.exe -u %s %s
library/bisect,32,:hi,all(val >= x for val in a[i:hi])
library/bisect,42,:hi,all(val > x for val in a[i:hi])
library/http.client,52,:port,host:port
library/http.client,,:port,host:port
library/http.cookies,,`,!#$%&'*+-.^_`|~
library/nntplib,,:bytes,:bytes
library/nntplib,,:lines,:lines
library/nntplib,,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']"
@ -186,9 +187,6 @@ library/stdtypes,,:end,s[start:end]
library/urllib.request,,:close,Connection:close
library/urllib.request,,:password,"""joe:password@python.org"""
library/urllib.request,,:lang,"xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" lang=""en"">\n\n<head>\n"
library/xmlrpc.client,103,:pass,http://user:pass@host:port/path
library/xmlrpc.client,103,:port,http://user:pass@host:port/path
library/xmlrpc.client,103,:pass,user:pass
license,,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
license,,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
license,,`,"``Software''), to deal in the Software without restriction, including"

1 c-api/arg :ref PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
88 library/smtplib :port as well as a regular host:port server.
89 library/socket :: '5aef:2b::8'
90 library/sqlite3 :memory
91 library/sqlite3 :age :who select name_last, age from people where name_last=:who and age=:age cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})
92 library/sqlite3 :who :age select name_last, age from people where name_last=:who and age=:age cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})
93 library/ssl :My Organization Name (eg, company) [Internet Widgits Pty Ltd]:My Organization, Inc.
94 library/ssl :My Organizational Unit Name (eg, section) []:My Group
95 library/ssl :myserver Common Name (eg, YOUR name) []:myserver.mygroup.myorganization.com
112 library/urllib :port :port
113 library/urllib2 :password "joe:password@python.org"
114 library/uuid :uuid urn:uuid:12345678-1234-5678-1234-567812345678
115 library/xmlrpclib library/xmlrpc.client :pass http://user:pass@host:port/path
116 library/xmlrpclib library/xmlrpc.client :pass :port user:pass http://user:pass@host:port/path
117 library/xmlrpclib library/xmlrpc.client :port :pass http://user:pass@host:port/path user:pass
118 license ` THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
119 license :zooko mailto:zooko@zooko.com
120 license ` THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
173 faq/windows :REG .py :REG_SZ: c:\<path to python>\python.exe -u %s %s
174 library/bisect 32 :hi all(val >= x for val in a[i:hi])
175 library/bisect 42 :hi all(val > x for val in a[i:hi])
176 library/http.client 52 :port host:port
177 library/http.cookies ` !#$%&'*+-.^_`|~
178 library/nntplib :bytes :bytes
179 library/nntplib :lines :lines
180 library/nntplib :lines ['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']
187 library/urllib.request :close Connection:close
188 library/urllib.request :password "joe:password@python.org"
189 library/urllib.request :lang xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n\n<head>\n
library/xmlrpc.client 103 :pass http://user:pass@host:port/path
library/xmlrpc.client 103 :port http://user:pass@host:port/path
library/xmlrpc.client 103 :pass user:pass
190 license ` * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
191 license ` * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
192 license ` ``Software''), to deal in the Software without restriction, including

View File

@ -23,7 +23,7 @@ class SkipTest(Exception):
"""
Raise this exception in a test to skip it.
Usually you can use TestResult.skip() or one of the skipping decorators
Usually you can use TestCase.skipTest() or one of the skipping decorators
instead of raising this directly.
"""