largely improve and reshuffle docs, heading strongly towards a 1.1.0

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-11-05 03:18:55 +01:00
parent b04a04cabd
commit a5a94c4e8f
31 changed files with 645 additions and 780 deletions

View File

@@ -2,20 +2,14 @@
"""
py.test and pylib: rapid testing and development utils
- `py.test`_: cross-project testing tool with many advanced features
- `py.path`_: path abstractions over local and subversion files
- `py.code`_: dynamic code compile and traceback printing support
Compatibility: Linux, Win32, OSX, Python versions 2.4 through to 3.1.
For questions please check out http://pylib.org/contact.html
.. _`py.test`: http://pylib.org/test.html
.. _`py.path`: http://pylib.org/path.html
.. _`py.code`: http://pylib.org/html
this module uses apipkg.py for lazy-loading sub modules
and classes. The initpkg-dictionary below specifies
name->value mappings where value can be another namespace
dictionary or an import path.
(c) Holger Krekel and others, 2009
"""
version = "trunk"
version = "1.1.0"
__version__ = version = version or "1.1.x"
import py.apipkg

View File

@@ -46,6 +46,7 @@ class Parser:
self._groups.insert(i+1, group)
return group
addgroup = getgroup
def addgroup(self, name, description=""):
py.log._apiwarn("1.1", "use getgroup() which gets-or-creates")
return self.getgroup(name, description)

View File

@@ -70,7 +70,7 @@ def pytest_addoption(parser):
add_dist_options(parser)
else:
parser.epilog = (
"execnet missing: --looponfailing and distributed testing not available.")
"'execnet' package required for --looponfailing / distributed testing.")
def add_dist_options(parser):
# see http://pytest.org/help/dist")

View File

@@ -83,7 +83,7 @@ skipping on a missing import dependency
--------------------------------------------------
You can use the following import helper at module level
or within a test or setup function.
or within a test or test setup function::
docutils = py.test.importorskip("docutils")

View File

@@ -259,8 +259,8 @@ class TerminalReporter:
verinfo = ".".join(map(str, sys.version_info[:3]))
msg = "python: platform %s -- Python %s" % (sys.platform, verinfo)
msg += " -- pytest-%s" % (py.__version__)
if self.config.option.verbose or self.config.option.debug or getattr(self.config.option, 'pastebin', None):
msg += " -- pytest-%s" % (py.__version__)
msg += " -- " + str(sys.executable)
self.write_line(msg)

View File

@@ -1,16 +1,21 @@
"""
provide temporary directories to test functions and methods.
"""provide temporary directories to test functions.
example:
pytest_plugins = "pytest_tmpdir"
usage example::
def test_plugin(tmpdir):
tmpdir.join("hello").write("hello")
.. _`py.path.local`: ../../path.html
"""
import py
def pytest_funcarg__tmpdir(request):
"""return a temporary directory path object
unique to each test function invocation,
created as a sub directory of the base temporary
directory. The returned object is a `py.path.local`_
path object.
"""
name = request.function.__name__
return request.config.mktemp(name, numbered=True)