diff --git a/CHANGELOG b/CHANGELOG
index 3f7332973..b193e84fe 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,7 @@
+Changes between 1.3.4 and 2.0.0dev0
+----------------------------------------------
-Changes between 1.3.4 and 1.4.0.dev0
-==================================================
-
+- pytest-2.0 is now its own package and depends on pylib
- fix issue126 - introduce py.test.set_trace() to trace execution via
PDB during the running of tests even if capturing is ongoing.
- fix issue123 - new "python -m py.test" invocation for py.test
@@ -21,7 +21,7 @@ Changes between 1.3.4 and 1.4.0.dev0
- introduce py.builtin.any()
Changes between 1.3.3 and 1.3.4
-==================================================
+----------------------------------------------
- fix issue111: improve install documentation for windows
- fix issue119: fix custom collectability of __init__.py as a module
@@ -30,7 +30,7 @@ Changes between 1.3.3 and 1.3.4
- fix issue118: new --tb=native for presenting cpython-standard exceptions
Changes between 1.3.2 and 1.3.3
-==================================================
+----------------------------------------------
- fix issue113: assertion representation problem with triple-quoted strings
(and possibly other cases)
@@ -45,7 +45,7 @@ Changes between 1.3.2 and 1.3.3
- remove trailing whitespace in all py/text distribution files
Changes between 1.3.1 and 1.3.2
-==================================================
+----------------------------------------------
New features
++++++++++++++++++
@@ -120,7 +120,7 @@ Bug fixes / Maintenance
- ship distribute_setup.py version 0.6.13
Changes between 1.3.0 and 1.3.1
-==================================================
+---------------------------------------------
New features
++++++++++++++++++
@@ -192,7 +192,7 @@ Fixes / Maintenance
Changes between 1.2.1 and 1.3.0
-==================================================
+---------------------------------------------
- deprecate --report option in favour of a new shorter and easier to
remember -r option: it takes a string argument consisting of any
@@ -257,7 +257,7 @@ Changes between 1.2.1 and 1.3.0
Changes between 1.2.1 and 1.2.0
-=====================================
+---------------------------------------------
- refined usage and options for "py.cleanup"::
@@ -296,7 +296,7 @@ Changes between 1.2.1 and 1.2.0
- fix plugin links
Changes between 1.2 and 1.1.1
-=====================================
+---------------------------------------------
- moved dist/looponfailing from py.test core into a new
separately released pytest-xdist plugin.
@@ -380,7 +380,7 @@ Changes between 1.2 and 1.1.1
Changes between 1.1.1 and 1.1.0
-=====================================
+---------------------------------------------
- introduce automatic plugin registration via 'pytest11'
entrypoints via setuptools' pkg_resources.iter_entry_points
@@ -399,7 +399,7 @@ Changes between 1.1.1 and 1.1.0
report a correct location
Changes between 1.1.0 and 1.0.2
-=====================================
+---------------------------------------------
* adjust and improve docs
@@ -484,7 +484,7 @@ Changes between 1.1.0 and 1.0.2
* simplified internal localpath implementation
Changes between 1.0.1 and 1.0.2
-=====================================
+-------------------------------------------
* fixing packaging issues, triggered by fedora redhat packaging,
also added doc, examples and contrib dirs to the tarball.
@@ -492,7 +492,7 @@ Changes between 1.0.1 and 1.0.2
* added a documentation link to the new django plugin.
Changes between 1.0.0 and 1.0.1
-=====================================
+-------------------------------------------
* added a 'pytest_nose' plugin which handles nose.SkipTest,
nose-style function/method/generator setup/teardown and
@@ -526,13 +526,13 @@ Changes between 1.0.0 and 1.0.1
renamed some internal methods and argnames
Changes between 1.0.0b9 and 1.0.0
-=====================================
+-------------------------------------------
* more terse reporting try to show filesystem path relatively to current dir
* improve xfail output a bit
Changes between 1.0.0b8 and 1.0.0b9
-=====================================
+-------------------------------------------
* cleanly handle and report final teardown of test setup
@@ -566,7 +566,7 @@ Changes between 1.0.0b8 and 1.0.0b9
Changes between 1.0.0b7 and 1.0.0b8
-=====================================
+-------------------------------------------
* pytest_unittest-plugin is now enabled by default
@@ -595,7 +595,7 @@ Changes between 1.0.0b7 and 1.0.0b8
thanks Radomir.
Changes between 1.0.0b3 and 1.0.0b7
-=============================================
+-------------------------------------------
* renamed py.test.xfail back to py.test.mark.xfail to avoid
two ways to decorate for xfail
@@ -620,7 +620,7 @@ Changes between 1.0.0b3 and 1.0.0b7
* make __name__ == "__channelexec__" for remote_exec code
Changes between 1.0.0b1 and 1.0.0b3
-=============================================
+-------------------------------------------
* plugin classes are removed: one now defines
hooks directly in conftest.py or global pytest_*.py
@@ -637,7 +637,7 @@ Changes between 1.0.0b1 and 1.0.0b3
Changes between 0.9.2 and 1.0.0b1
-=============================================
+-------------------------------------------
* introduced new "funcarg" setup method,
see doc/test/funcarg.txt
@@ -661,7 +661,7 @@ Changes between 0.9.2 and 1.0.0b1
XXX lots of things missing here XXX
Changes between 0.9.1 and 0.9.2
-===============================
+-------------------------------------------
* refined installation and metadata, created new setup.py,
now based on setuptools/ez_setup (thanks to Ralf Schmitt
@@ -694,7 +694,7 @@ Changes between 0.9.1 and 0.9.2
* there now is a py.__version__ attribute
Changes between 0.9.0 and 0.9.1
-===============================
+-------------------------------------------
This is a fairly complete list of changes between 0.9 and 0.9.1, which can
serve as a reference for developers.
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 000000000..1a34cf6fe
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = _build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make ' where is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pytest.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pytest.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/pytest"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pytest"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ make -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/doc/_static/sphinxdoc.css b/doc/_static/sphinxdoc.css
new file mode 100644
index 000000000..780f7ba74
--- /dev/null
+++ b/doc/_static/sphinxdoc.css
@@ -0,0 +1,339 @@
+/*
+ * sphinxdoc.css_t
+ * ~~~~~~~~~~~~~~~
+ *
+ * Sphinx stylesheet -- sphinxdoc theme. Originally created by
+ * Armin Ronacher for Werkzeug.
+ *
+ * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+@import url("basic.css");
+
+/* -- page layout ----------------------------------------------------------- */
+
+body {
+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+ 'Verdana', sans-serif;
+ font-size: 14px;
+ letter-spacing: -0.01em;
+ line-height: 150%;
+ text-align: center;
+ background-color: #BFD1D4;
+ color: black;
+ padding: 0;
+ border: 1px solid #aaa;
+
+ margin: 0px 80px 0px 80px;
+ min-width: 740px;
+}
+
+div.document {
+ background-color: white;
+ text-align: left;
+ background-image: url(contents.png);
+ background-repeat: repeat-x;
+}
+
+div.bodywrapper {
+ margin: 0 360px 0 0;
+ border-right: 1px solid #ccc;
+}
+
+div.body {
+ margin: 0;
+ padding: 0.5em 20px 20px 20px;
+}
+
+div.related {
+ font-size: 1em;
+}
+
+div.related ul {
+ background-image: url(navigation.png);
+ height: 2em;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+}
+
+div.related ul li {
+ margin: 0;
+ padding: 0;
+ height: 2em;
+ float: left;
+}
+
+div.related ul li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+div.related ul li a {
+ margin: 0;
+ padding: 0 5px 0 5px;
+ line-height: 1.75em;
+ color: #EE9816;
+}
+
+div.related ul li a:hover {
+ color: #3CA8E7;
+}
+
+div.sphinxsidebarwrapper {
+ padding: 0;
+}
+
+div.sphinxsidebar {
+ margin: 0;
+ padding: 0.5em 15px 15px 0;
+ width: 310px;
+ float: right;
+ font-size: 1em;
+ text-align: left;
+}
+
+div.sphinxsidebar h3, div.sphinxsidebar h4 {
+ margin: 1em 0 0.5em 0;
+ font-size: 1em;
+ padding: 0.1em 0 0.1em 0.5em;
+ color: white;
+ border: 2px solid #86989B;
+ background-color: #AFC1C4;
+}
+
+div.sphinxsidebar h3 a {
+ color: white;
+}
+
+div.sphinxsidebar ul {
+ padding-left: 1.5em;
+ margin-top: 7px;
+ padding: 0;
+ line-height: 130%;
+}
+
+div.sphinxsidebar ul ul {
+ margin-left: 20px;
+}
+
+div.footer {
+ background-color: #E3EFF1;
+ color: #86989B;
+ padding: 3px 8px 3px 0;
+ clear: both;
+ font-size: 0.8em;
+ text-align: right;
+}
+
+div.footer a {
+ color: #86989B;
+ text-decoration: underline;
+}
+
+/* -- body styles ----------------------------------------------------------- */
+
+p {
+ margin: 0.8em 0 0.5em 0;
+}
+
+a {
+ color: #CA7900;
+ text-decoration: none;
+}
+
+a:hover {
+ color: #2491CF;
+}
+
+div.body a {
+ text-decoration: underline;
+}
+
+h1 {
+ margin: 0;
+ padding: 0.7em 0 0.3em 0;
+ font-size: 1.5em;
+ color: #11557C;
+}
+
+h2 {
+ margin: 1.3em 0 0.2em 0;
+ font-size: 1.35em;
+ padding: 0;
+}
+
+h3 {
+ margin: 1em 0 -0.3em 0;
+ font-size: 1.2em;
+}
+
+div.body h1 a, div.body h2 a, div.body h3 a, div.body h4 a, div.body h5 a, div.body h6 a {
+ color: black!important;
+}
+
+h1 a.anchor, h2 a.anchor, h3 a.anchor, h4 a.anchor, h5 a.anchor, h6 a.anchor {
+ display: none;
+ margin: 0 0 0 0.3em;
+ padding: 0 0.2em 0 0.2em;
+ color: #aaa!important;
+}
+
+h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor,
+h5:hover a.anchor, h6:hover a.anchor {
+ display: inline;
+}
+
+h1 a.anchor:hover, h2 a.anchor:hover, h3 a.anchor:hover, h4 a.anchor:hover,
+h5 a.anchor:hover, h6 a.anchor:hover {
+ color: #777;
+ background-color: #eee;
+}
+
+a.headerlink {
+ color: #c60f0f!important;
+ font-size: 1em;
+ margin-left: 6px;
+ padding: 0 4px 0 4px;
+ text-decoration: none!important;
+}
+
+a.headerlink:hover {
+ background-color: #ccc;
+ color: white!important;
+}
+
+cite, code, tt {
+ font-family: 'Consolas', 'Deja Vu Sans Mono',
+ 'Bitstream Vera Sans Mono', monospace;
+ font-size: 0.95em;
+ letter-spacing: 0.01em;
+}
+
+tt {
+ background-color: #f2f2f2;
+ border-bottom: 1px solid #ddd;
+ color: #333;
+}
+
+tt.descname, tt.descclassname, tt.xref {
+ border: 0;
+}
+
+hr {
+ border: 1px solid #abc;
+ margin: 2em;
+}
+
+a tt {
+ border: 0;
+ color: #CA7900;
+}
+
+a tt:hover {
+ color: #2491CF;
+}
+
+pre {
+ font-family: 'Consolas', 'Deja Vu Sans Mono',
+ 'Bitstream Vera Sans Mono', monospace;
+ font-size: 0.95em;
+ letter-spacing: 0.015em;
+ line-height: 120%;
+ padding: 0.5em;
+ border: 1px solid #ccc;
+ background-color: #f8f8f8;
+}
+
+pre a {
+ color: inherit;
+ text-decoration: underline;
+}
+
+td.linenos pre {
+ padding: 0.5em 0;
+}
+
+div.quotebar {
+ background-color: #f8f8f8;
+ max-width: 250px;
+ float: right;
+ padding: 2px 7px;
+ border: 1px solid #ccc;
+}
+
+div.topic {
+ background-color: #f8f8f8;
+}
+
+table {
+ border-collapse: collapse;
+ margin: 0 -0.5em 0 -0.5em;
+}
+
+table td, table th {
+ padding: 0.2em 0.5em 0.2em 0.5em;
+}
+
+div.admonition, div.warning {
+ font-size: 0.9em;
+ margin: 1em 0 1em 0;
+ border: 1px solid #86989B;
+ background-color: #f7f7f7;
+ padding: 0;
+}
+
+div.admonition p, div.warning p {
+ margin: 0.5em 1em 0.5em 1em;
+ padding: 0;
+}
+
+div.admonition pre, div.warning pre {
+ margin: 0.4em 1em 0.4em 1em;
+}
+
+div.admonition p.admonition-title,
+div.warning p.admonition-title {
+ margin: 0;
+ padding: 0.1em 0 0.1em 0.5em;
+ color: white;
+ border-bottom: 1px solid #86989B;
+ font-weight: bold;
+ background-color: #AFC1C4;
+}
+
+div.warning {
+ border: 1px solid #940000;
+}
+
+div.warning p.admonition-title {
+ background-color: #CF0000;
+ border-bottom-color: #940000;
+}
+
+div.admonition ul, div.admonition ol,
+div.warning ul, div.warning ol {
+ margin: 0.1em 0.5em 0.5em 3em;
+ padding: 0;
+}
+
+div.versioninfo {
+ margin: 1em 0 0 0;
+ border: 1px solid #ccc;
+ background-color: #DDEAF0;
+ padding: 8px;
+ line-height: 1.3em;
+ font-size: 0.9em;
+}
+
+.viewcode-back {
+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva',
+ 'Verdana', sans-serif;
+}
+
+div.viewcode-block:target {
+ background-color: #f4debf;
+ border-top: 1px solid #ac9;
+ border-bottom: 1px solid #ac9;
+}
diff --git a/doc/apiref.txt b/doc/apiref.txt
new file mode 100644
index 000000000..7cddd7219
--- /dev/null
+++ b/doc/apiref.txt
@@ -0,0 +1,16 @@
+
+py.test reference documentation
+================================================
+
+.. toctree::
+ :maxdepth: 2
+
+ funcargs.txt
+ xunit_setup.txt
+ capture.txt
+ monkeypatch.txt
+ skipping.txt
+ mark.txt
+ doctest.txt
+ recwarn.txt
+
diff --git a/doc/bin.txt b/doc/bin.txt
deleted file mode 100644
index ee04819f3..000000000
--- a/doc/bin.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-======================
-pylib scripts
-======================
-
-The pylib installs several scripts to support testing and (python)
-development. If working from a checkout you may also add ``bin`` to
-your ``PATH`` environment variable which makes the scripts available on
-your shell prompt.
-
-``py.test`` and ``py.test-$VERSION``
-============================================
-
-The ``py.test`` executable is the main tool that the py lib offers;
-in fact most code in the py lib is geared towards supporting the
-testing process. See the `py.test documentation`_ for extensive
-documentation. The ``py.test-$VERSION`` is the same script with
-an interpreter specific suffix appended to make
-several versions of py.test for using specific interpreters
-accessible:
-
-* CPython2.4: py.test-2.4
-* CPython2.5: py.test-2.5
-* ...
-* CPython3.1: py.test-3.1
-* Jython-2.5.1: py.test-jython
-* pypy-$SUFFIX: py.test-pypy-$SUFFIX
-
-.. _`py.test documentation`: test/index.html
-
-``py.which`` and ``py.which-$VERSION``
-=========================================
-
-Usage: ``py.which modulename``
-
-Print the ``__file__`` of the module that is imported via ``import modulename``.
-The version-suffix is the same as with ``py.test`` above.
-
-``py.cleanup``
-==============
-
-Usage: ``py.cleanup [PATH]``
-
-Delete pyc file recursively, starting from ``PATH`` (which defaults to the
-current working directory). Don't follow links and don't recurse into
-directories with a ".".
-
-``py.countloc``
-===============
-
-Usage: ``py.countloc [PATHS]``
-
-Count (non-empty) lines of python code and number of python files recursively
-starting from a ``PATHS`` given on the command line (starting from the current
-working directory). Distinguish between test files and normal ones and report
-them separately.
-
-``py.lookup``
-=============
-
-Usage: ``py.lookup SEARCH_STRING [options]``
-
-Looks recursively at Python files for a ``SEARCH_STRING``, starting from the
-present working directory. Prints the line, with the filename and line-number
-prepended.
-
diff --git a/doc/capture.txt b/doc/capture.txt
new file mode 100644
index 000000000..6399c950e
--- /dev/null
+++ b/doc/capture.txt
@@ -0,0 +1,73 @@
+
+Capturing of stdout/stderr output
+=========================================================
+
+By default ``stdout`` and ``stderr`` output is captured separately for
+setup and test execution code. If a test or a setup method fails its
+according output will usually be shown along with the failure traceback.
+In addition, ``stdin`` is set to a "null" object which will fail all
+attempts to read from it. This is important if some code paths in
+test otherwise might lead to waiting for input - which is usually
+not desired when running automated tests.
+
+Setting capturing methods or disabling capturing
+-------------------------------------------------
+
+There are two ways in which ``py.test`` can perform capturing:
+
+* ``fd`` level capturing (default): All writes going to the operating
+ system file descriptors 1 and 2 will be captured, for example writes such
+ as ``os.write(1, 'hello')``. Capturing on ``fd``-level also includes
+ **output from subprocesses**.
+
+* ``sys`` level capturing: The ``sys.stdout`` and ``sys.stderr`` will
+ will be replaced with in-memory files and the ``print`` builtin or
+ output from code like ``sys.stderr.write(...)`` will be captured with
+ this method.
+
+
+You can influence output capturing mechanisms from the command line::
+
+ py.test -s # disable all capturing
+ py.test --capture=sys # replace sys.stdout/stderr with in-mem files
+ py.test --capture=fd # also point filedescriptors 1 and 2 to temp file
+
+If you set capturing values in a conftest file like this::
+
+ # conftest.py
+ option_capture = 'fd'
+
+then all tests in that directory will execute with "fd" style capturing.
+
+Accessing captured output from a test function
+---------------------------------------------------
+
+The `funcarg mechanism`_ allows test function a very easy
+way to access the captured output by simply using the names
+``capsys`` or ``capfd`` in the test function signature. Here
+is an example test function that performs some output related
+checks::
+
+ def test_myoutput(capsys): # or use "capfd" for fd-level
+ print ("hello")
+ sys.stderr.write("world\n")
+ out, err = capsys.readouterr()
+ assert out == "hello\n"
+ assert err == "world\n"
+ print "next"
+ out, err = capsys.readouterr()
+ assert out == "next\n"
+
+The ``readouterr()`` call snapshots the output so far -
+and capturing will be continued. After the test
+function finishes the original streams will
+be restored. Using ``capsys`` this way frees your
+test from having to care about setting/resetting
+output streams and also interacts well with py.test's
+own per-test capturing.
+
+If you want to capture on ``fd`` level you can use
+the ``capfd`` function argument which offers the exact
+same interface.
+
+.. include:: links.inc
diff --git a/doc/changelog.txt b/doc/changelog.txt
index cfe65b34f..0c816b606 100644
--- a/doc/changelog.txt
+++ b/doc/changelog.txt
@@ -1,2 +1,5 @@
+Changelog history
+=================================
+
.. include:: ../CHANGELOG
diff --git a/doc/code.txt b/doc/code.txt
deleted file mode 100644
index d69610ab5..000000000
--- a/doc/code.txt
+++ /dev/null
@@ -1,134 +0,0 @@
-================================================================================
-py.code: higher level python code and introspection objects
-================================================================================
-
-The ``py.code`` part of the pylib contains some functionality to help
-dealing with Python code objects. Even though working with Python's internal
-code objects (as found on frames and callables) can be very powerful, it's
-usually also quite cumbersome, because the API provided by core Python is
-relatively low level and not very accessible.
-
-The ``py.code`` library tries to simplify accessing the code objects as well
-as creating them. There is a small set of interfaces a user needs to deal with,
-all nicely bundled together, and with a rich set of 'Pythonic' functionality.
-
-Contents of the library
-=======================
-
-Every object in the ``py.code`` library wraps a code Python object related
-to code objects, source code, frames and tracebacks: the ``py.code.Code``
-class wraps code objects, ``py.code.Source`` source snippets,
-``py.code.Traceback` exception tracebacks, ``py.code.Frame`` frame
-objects (as found in e.g. tracebacks) and ``py.code.ExceptionInfo`` the
-tuple provided by sys.exc_info() (containing exception and traceback
-information when an exception occurs). Also in the library is a helper function
-``py.code.compile()`` that provides the same functionality as Python's
-built-in 'compile()' function, but returns a wrapped code object.
-
-The wrappers
-============
-
-``py.code.Code``
--------------------
-
-Code objects are instantiated with a code object or a callable as argument,
-and provide functionality to compare themselves with other Code objects, get to
-the source file or its contents, create new Code objects from scratch, etc.
-
-A quick example::
-
- >>> import py
- >>> c = py.code.Code(py.path.local.read)
- >>> c.path.basename
- 'common.py'
- >>> isinstance(c.source(), py.code.Source)
- True
- >>> str(c.source()).split('\n')[0]
- "def read(self, mode='r'):"
-
-``py.code.Source``
----------------------
-
-Source objects wrap snippets of Python source code, providing a simple yet
-powerful interface to read, deindent, slice, compare, compile and manipulate
-them, things that are not so easy in core Python.
-
-Example::
-
- >>> s = py.code.Source("""\
- ... def foo():
- ... print "foo"
- ... """)
- >>> str(s).startswith('def') # automatic de-indentation!
- True
- >>> s.isparseable()
- True
- >>> sub = s.getstatement(1) # get the statement starting at line 1
- >>> str(sub).strip() # XXX why is the strip() required?!?
- 'print "foo"'
-
-
-``py.code.Traceback``
-------------------------
-
-Tracebacks are usually not very easy to examine, you need to access certain
-somewhat hidden attributes of the traceback's items (resulting in expressions
-such as 'fname = tb.tb_next.tb_frame.f_code.co_filename'). The Traceback
-interface (and its TracebackItem children) tries to improve this.
-
-Example::
-
- >>> import sys
- >>> try:
- ... py.path.local(100) # illegal argument
- ... except:
- ... exc, e, tb = sys.exc_info()
- >>> t = py.code.Traceback(tb)
- >>> first = t[1] # get the second entry (first is in this doc)
- >>> first.path.basename # second is in py/path/local.py
- 'local.py'
- >>> isinstance(first.statement, py.code.Source)
- True
- >>> str(first.statement).strip().startswith('raise ValueError')
- True
-
-``py.code.Frame``
---------------------
-
-Frame wrappers are used in ``py.code.Traceback`` items, and will usually not
-directly be instantiated. They provide some nice methods to evaluate code
-'inside' the frame (using the frame's local variables), get to the underlying
-code (frames have a code attribute that points to a ``py.code.Code`` object)
-and examine the arguments.
-
-Example (using the 'first' TracebackItem instance created above)::
-
- >>> frame = first.frame
- >>> isinstance(frame.code, py.code.Code)
- True
- >>> isinstance(frame.eval('self'), py.path.local)
- True
- >>> [namevalue[0] for namevalue in frame.getargs()]
- ['cls', 'path']
-
-``py.code.ExceptionInfo``
-----------------------------
-
-A wrapper around the tuple returned by sys.exc_info() (will call sys.exc_info()
-itself if the tuple is not provided as an argument), provides some handy
-attributes to easily access the traceback and exception string.
-
-Example::
-
- >>> import sys
- >>> try:
- ... foobar()
- ... except:
- ... excinfo = py.code.ExceptionInfo()
- >>> excinfo.typename
- 'NameError'
- >>> isinstance(excinfo.traceback, py.code.Traceback)
- True
- >>> excinfo.exconly()
- "NameError: name 'foobar' is not defined"
-
diff --git a/doc/conf.py b/doc/conf.py
new file mode 100644
index 000000000..69a7c5a8a
--- /dev/null
+++ b/doc/conf.py
@@ -0,0 +1,260 @@
+# -*- coding: utf-8 -*-
+#
+# pytest documentation build configuration file, created by
+# sphinx-quickstart on Fri Oct 8 17:54:28 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.txt'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'pytest'
+copyright = u'2010, holger krekel et aliter'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '2.0.0'
+# The full version, including alpha/beta/rc tags.
+release = '2.0.0dev0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build', 'example', 'test', 'announce'] # XXX
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'sphinxdoc'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# " v documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'pytestdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'pytest.tex', u'pytest Documentation',
+ u'holger krekel et aliter', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'pytest', u'pytest Documentation',
+ [u'holger krekel et aliter'], 1)
+]
+
+
+# -- Options for Epub output ---------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = u'pytest'
+epub_author = u'holger krekel et aliter'
+epub_publisher = u'holger krekel et aliter'
+epub_copyright = u'2010, holger krekel et aliter'
+
+# The language of the text. It defaults to the language option
+# or en if the language is not set.
+#epub_language = ''
+
+# The scheme of the identifier. Typical schemes are ISBN or URL.
+#epub_scheme = ''
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#epub_identifier = ''
+
+# A unique identification for the text.
+#epub_uid = ''
+
+# HTML files that should be inserted before the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_pre_files = []
+
+# HTML files shat should be inserted after the pages created by sphinx.
+# The format is a list of tuples containing the path and title.
+#epub_post_files = []
+
+# A list of files that should not be packed into the epub file.
+#epub_exclude_files = []
+
+# The depth of the table of contents in toc.ncx.
+#epub_tocdepth = 3
+
+# Allow duplicate toc entries.
+#epub_tocdup = True
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {'http://docs.python.org/': None}
diff --git a/doc/confrest.py b/doc/confrest.py
deleted file mode 100644
index 40f1fd5a8..000000000
--- a/doc/confrest.py
+++ /dev/null
@@ -1,289 +0,0 @@
-import py
-
-from pytest.plugin.pytest_restdoc import convert_rest_html, strip_html_header
-
-html = py.xml.html
-
-class css:
- #pagetitle = "pagetitle"
- contentspace = "contentspace"
- menubar = "menubar"
- navspace = "navspace"
- versioninfo = "versioninfo"
-
-class Page(object):
- doctype = ('\n')
- googlefragment = """
-
-
-"""
-
- def __init__(self, project, title, targetpath, stylesheeturl=None,
- type="text/html", encoding="ISO-8859-1"):
- self.project = project
- self.title = project.prefix_title + title
- self.targetpath = targetpath
- self.stylesheeturl = stylesheeturl
- self.type = type
- self.encoding = encoding
-
- self.body = html.body()
- self.head = html.head()
- self._root = html.html(self.head, self.body)
- self.fill()
-
- def a_href(self, name, url, **kwargs):
- return html.a(name, class_="menu", href=url, **kwargs)
-
- def a_docref(self, name, relhtmlpath):
- docpath = self.project.docpath
- return html.div(html.a(name, class_="menu",
- href=relpath(self.targetpath.strpath,
- docpath.join(relhtmlpath).strpath)))
-
- def a_apigenref(self, name, relhtmlpath):
- apipath = self.project.apigenpath
- return html.a(name, class_="menu",
- href=relpath(self.targetpath.strpath,
- apipath.join(relhtmlpath).strpath))
-
- def fill_menubar(self):
- items = [
- self.a_docref("INSTALL", "install.html"),
- self.a_docref("CONTACT", "contact.html"),
- self.a_docref("CHANGELOG", "changelog.html"),
- self.a_docref("FAQ", "faq.html"),
- html.div(
- html.h3("py.test:"),
- self.a_docref("Index", "test/index.html"),
- self.a_docref("Quickstart", "test/quickstart.html"),
- self.a_docref("Features", "test/features.html"),
- self.a_docref("Funcargs", "test/funcargs.html"),
- self.a_docref("Plugins", "test/plugin/index.html"),
- self.a_docref("Customize", "test/customize.html"),
- self.a_docref("Tutorials", "test/talks.html"),
- self.a_href("hudson-tests", "http://hudson.testrun.org")
- ),
- html.div(
- html.h3("supporting APIs:"),
- self.a_docref("Index", "index.html"),
- self.a_docref("py.path", "path.html"),
- self.a_docref("py.code", "code.html"),
- )
- #self.a_docref("py.code", "code.html"),
- #self.a_apigenref("api", "api/index.html"),
- #self.a_apigenref("source", "source/index.html"),
- #self.a_href("source", "http://bitbucket.org/hpk42/py-trunk/src/"),
- ]
- self.menubar = html.div(id=css.menubar, *[
- html.div(item) for item in items])
- version = py.version
- announcelink = self.a_docref("%s ANN" % version,
- "announce/release-%s.html" %(version,))
- self.menubar.insert(0,
- html.div(announcelink))
- #self.a_href("%s-%s" % (self.title, py.version),
- # "http://pypi.python.org/pypi/py/%s" % version,
- #id="versioninfo",
-
- def fill(self):
- content_type = "%s;charset=%s" %(self.type, self.encoding)
- self.head.append(html.title(self.title))
- self.head.append(html.meta(name="Content-Type", content=content_type))
- if self.stylesheeturl:
- self.head.append(
- html.link(href=self.stylesheeturl,
- media="screen", rel="stylesheet",
- type="text/css"))
- self.fill_menubar()
-
- self.body.append(html.div(
- self.project.logo,
- self.menubar,
- id=css.navspace,
- ))
-
- #self.body.append(html.div(self.title, id=css.pagetitle))
- self.contentspace = html.div(id=css.contentspace)
- self.body.append(self.contentspace)
-
- def unicode(self, doctype=True):
- page = self._root.unicode()
- page = page.replace("
-
-
-
", self.googlefragment + "")
- if doctype:
- return self.doctype + page
- else:
- return page
-
-class PyPage(Page):
- def get_menubar(self):
- menubar = super(PyPage, self).get_menubar()
- # base layout
- menubar.append(
- html.a("issue", href="https://codespeak.net/issue/py-dev/",
- class_="menu"),
- )
- return menubar
-
-
-def getrealname(username):
- try:
- import uconf
- except ImportError:
- return username
- try:
- user = uconf.system.User(username)
- except KeyboardInterrupt:
- raise
- try:
- return user.realname or username
- except KeyError:
- return username
-
-
-class Project:
- mydir = py.path.local(__file__).dirpath()
- title = "py lib"
- prefix_title = "" # we have a logo already containing "py lib"
- encoding = 'latin1'
- logo = html.div(
- html.a(
- html.img(alt="py lib", id='pyimg', height=114/2, width=154/2,
- src="http://codespeak.net/img/pylib.png"),
- href="http://pylib.org"))
- Page = PyPage
-
- def __init__(self, sourcepath=None):
- if sourcepath is None:
- sourcepath = self.mydir
- self.setpath(sourcepath)
-
- def setpath(self, sourcepath, docpath=None,
- apigenpath=None, stylesheet=None):
- self.sourcepath = sourcepath
- if docpath is None:
- docpath = sourcepath
- self.docpath = docpath
- if apigenpath is None:
- apigenpath = docpath
- self.apigenpath = apigenpath
- if stylesheet is None:
- p = sourcepath.join("style.css")
- if p.check():
- self.stylesheet = p
- else:
- self.stylesheet = None
- else:
- p = sourcepath.join(stylesheet)
- if p.check():
- stylesheet = p
- self.stylesheet = stylesheet
- #assert self.stylesheet
- self.apigen_relpath = relpath(
- self.docpath.strpath + '/', self.apigenpath.strpath + '/')
-
- def get_content(self, txtpath, encoding):
- return unicode(txtpath.read(), encoding)
-
- def get_htmloutputpath(self, txtpath):
- reloutputpath = txtpath.new(ext='.html').relto(self.sourcepath)
- return self.docpath.join(reloutputpath)
-
- def process(self, txtpath):
- encoding = self.encoding
- content = self.get_content(txtpath, encoding)
- outputpath = self.get_htmloutputpath(txtpath)
-
- stylesheet = self.stylesheet
- if isinstance(stylesheet, py.path.local):
- if not self.docpath.join(stylesheet.basename).check():
- docpath.ensure(dir=True)
- stylesheet.copy(docpath)
- stylesheet = relpath(outputpath.strpath,
- self.docpath.join(stylesheet.basename).strpath)
-
- content = convert_rest_html(content, txtpath,
- stylesheet=stylesheet, encoding=encoding)
- content = strip_html_header(content, encoding=encoding)
-
- title = txtpath.purebasename
- if txtpath.dirpath().basename == "test":
- title = "py.test " + title
- # title = "[%s] %s" % (txtpath.purebasename, py.version)
- page = self.Page(self, title,
- outputpath, stylesheeturl=stylesheet)
-
- try:
- modified = py.process.cmdexec(
- "hg tip --template 'modified {date|shortdate}'"
- )
- except py.process.cmdexec.Error:
- modified = " "
-
- #page.body.append(html.div(modified, id="docinfoline"))
-
- page.contentspace.append(py.xml.raw(content))
- outputpath.ensure().write(page.unicode().encode(encoding))
-
-# XXX this function comes from apigen/linker.py, put it
-# somewhere in py lib
-import os
-def relpath(p1, p2, sep=os.path.sep, back='..', normalize=True):
- """ create a relative path from p1 to p2
-
- sep is the seperator used for input and (depending
- on the setting of 'normalize', see below) output
-
- back is the string used to indicate the parent directory
-
- when 'normalize' is True, any backslashes (\) in the path
- will be replaced with forward slashes, resulting in a consistent
- output on Windows and the rest of the world
-
- paths to directories must end on a / (URL style)
- """
- if normalize:
- p1 = p1.replace(sep, '/')
- p2 = p2.replace(sep, '/')
- sep = '/'
- # XXX would be cool to be able to do long filename
- # expansion and drive
- # letter fixes here, and such... iow: windows sucks :(
- if (p1.startswith(sep) ^ p2.startswith(sep)):
- raise ValueError("mixed absolute relative path: %r -> %r" %(p1, p2))
- fromlist = p1.split(sep)
- tolist = p2.split(sep)
-
- # AA
- # AA BB -> AA/BB
- #
- # AA BB
- # AA CC -> CC
- #
- # AA BB
- # AA -> ../AA
-
- diffindex = 0
- for x1, x2 in zip(fromlist, tolist):
- if x1 != x2:
- break
- diffindex += 1
- commonindex = diffindex - 1
-
- fromlist_diff = fromlist[diffindex:]
- tolist_diff = tolist[diffindex:]
-
- if not fromlist_diff:
- return sep.join(tolist[commonindex:])
- backcount = len(fromlist_diff)
- if tolist_diff:
- return sep.join([back,]*(backcount-1) + tolist_diff)
- return sep.join([back,]*(backcount) + tolist[commonindex:])
diff --git a/doc/conftest.py b/doc/conftest.py
deleted file mode 100644
index 6f7afeb58..000000000
--- a/doc/conftest.py
+++ /dev/null
@@ -1,8 +0,0 @@
-#XXX make work: excludedirs = ['_build']
-import py
-pytest_plugins = ['pytest_restdoc']
-collect_ignore = ['test/attic.txt']
-
-def pytest_runtest_setup(item):
- if item.fspath.ext == ".txt":
- py.test.importorskip("pygments") # for raising an error
diff --git a/doc/test/customize.txt b/doc/customize.txt
similarity index 99%
rename from doc/test/customize.txt
rename to doc/customize.txt
index dff6b3e9d..e6acfd0cc 100644
--- a/doc/test/customize.txt
+++ b/doc/customize.txt
@@ -2,10 +2,6 @@
Customizing and Extending py.test
================================================
-.. contents::
- :local:
- :depth: 2
-
basic test configuration
===================================
diff --git a/doc/develop.txt b/doc/develop.txt
new file mode 100644
index 000000000..31671e611
--- /dev/null
+++ b/doc/develop.txt
@@ -0,0 +1,38 @@
+=================================================
+Feedback and contribute to py.test
+=================================================
+
+.. toctree::
+ :maxdepth: 2
+
+ contact.txt
+ faq.txt
+
+.. _checkout:
+
+Working from version control or a tarball
+=================================================
+
+To follow development or start experiments, checkout the
+complete code and documentation source with mercurial_::
+
+ hg clone https://bitbucket.org/hpk42/py-trunk/
+
+Development takes place on the 'trunk' branch.
+
+You can also go to the python package index and
+download and unpack a TAR file::
+
+ http://pypi.python.org/pypi/py/
+
+
+activating a checkout with setuptools
+--------------------------------------------
+
+With a working Distribute_ or setuptools_ installation you can type::
+
+ python setup.py develop
+
+in order to work inline with the tools and the lib of your checkout.
+
+.. include:: links.inc
diff --git a/doc/doctest.txt b/doc/doctest.txt
new file mode 100644
index 000000000..b7ca3465f
--- /dev/null
+++ b/doc/doctest.txt
@@ -0,0 +1,23 @@
+
+collect and run doctests from modules and test files.
+=========================================================
+
+By default all files matching the ``test*.txt`` pattern will
+be run through the python standard ``doctest`` module. You
+can change the pattern by issuing::
+
+ py.test --doctest-glob='*.rst'
+
+on the command line. You can also trigger running of doctests
+from docstrings in all python modules (including regular
+python test modules)::
+
+ py.test --doctest-modules
+
+You can make these changes permanent in your project by
+putting them into a conftest.py file like this::
+
+ # content of conftest.py
+ option_doctestmodules = True
+ option_doctestglob = "*.rst"
+
diff --git a/doc/download.html b/doc/download.html
deleted file mode 100644
index 5f4c46640..000000000
--- a/doc/download.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
-