From c614adcf4885af3174cbc645944bc0e64228ddf8 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Mon, 11 Oct 2010 00:14:32 +0200 Subject: [PATCH] move and consolidate some more plugin docs --HG-- branch : trunk --- doc/apiref.txt | 1 + doc/capture.txt | 2 +- doc/links.inc | 1 + doc/reporting.txt | 46 +++++++++++++++++++++++++++++++ doc/test/plugin/pastebin.txt | 43 ----------------------------- doc/test/plugin/restdoc.txt | 32 --------------------- doc/test/plugin/resultlog.txt | 31 --------------------- doc/test/plugin/tmpdir.txt | 11 -------- pytest/plugin/pytest_junitxml.py | 3 +- pytest/plugin/pytest_pastebin.py | 22 +-------------- pytest/plugin/pytest_resultlog.py | 8 +----- 11 files changed, 52 insertions(+), 148 deletions(-) create mode 100644 doc/reporting.txt delete mode 100644 doc/test/plugin/pastebin.txt delete mode 100644 doc/test/plugin/restdoc.txt delete mode 100644 doc/test/plugin/resultlog.txt diff --git a/doc/apiref.txt b/doc/apiref.txt index 7cddd7219..06252290a 100644 --- a/doc/apiref.txt +++ b/doc/apiref.txt @@ -13,4 +13,5 @@ py.test reference documentation mark.txt doctest.txt recwarn.txt + reporting.txt diff --git a/doc/capture.txt b/doc/capture.txt index 6399c950e..5316b17ab 100644 --- a/doc/capture.txt +++ b/doc/capture.txt @@ -42,7 +42,7 @@ 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 +The :ref:`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 diff --git a/doc/links.inc b/doc/links.inc index ecb738ecb..6a15c9998 100644 --- a/doc/links.inc +++ b/doc/links.inc @@ -11,3 +11,4 @@ .. _mercurial: http://mercurial.selenic.com/wiki/ .. _`setuptools`: http://pypi.python.org/pypi/setuptools .. _`distribute`: http://pypi.python.org/pypi/distribute +.. _hudon: http://hudson-ci.org/ diff --git a/doc/reporting.txt b/doc/reporting.txt new file mode 100644 index 000000000..593fca5b4 --- /dev/null +++ b/doc/reporting.txt @@ -0,0 +1,46 @@ +Sending output to files or to remote services +================================================================= + + + +creating JUnitXML format files +---------------------------------------------------- + +To create result files which can be read by Hudson_ or other Continous +integration servers, use this:: + + $ py.test --junitxml=path + +to create an XML file at ``path``. + +creating resultlog format files +---------------------------------------------------- + +To create plain-text machine-readable result files you can issue:: + + $ py.test --resultlog=path + +and look at the content at the ``path`` location. Such files are used e.g. +by the `PyPy-test`_ web page to show test results over several revisions. + +.. _`PyPy-test`: http://codespeak.net:8099/summary + + +send test report to pocoo pastebin service +----------------------------------------------------- + +**Creating a URL for each test failure**:: + + py.test --pastebin=failed + +This will submit test run information to a remote Paste service and +provide a URL for each failure. You may select tests as usual or add +for example ``-x`` if you only want to send one particular failure. + +**Creating a URL for a whole test session log**:: + + py.test --pastebin=all + +Currently only pasting to the http://paste.pocoo.org service is implemented. + +.. include:: links.inc diff --git a/doc/test/plugin/pastebin.txt b/doc/test/plugin/pastebin.txt deleted file mode 100644 index 944e5cf54..000000000 --- a/doc/test/plugin/pastebin.txt +++ /dev/null @@ -1,43 +0,0 @@ - -submit failure or test session information to a pastebin service. -================================================================= - - -.. contents:: - :local: - -Usage ----------- - -**Creating a URL for each test failure**:: - - py.test --pastebin=failed - -This will submit test run information to a remote Paste service and -provide a URL for each failure. You may select tests as usual or add -for example ``-x`` if you only want to send one particular failure. - -**Creating a URL for a whole test session log**:: - - py.test --pastebin=all - -Currently only pasting to the http://paste.pocoo.org service is implemented. - -command line options --------------------- - - -``--pastebin=mode`` - send failed|all info to Pocoo pastebin service. - -Start improving this plugin in 30 seconds -========================================= - - -1. Download `pytest_pastebin.py`_ plugin source code -2. put it somewhere as ``pytest_pastebin.py`` into your import path -3. a subsequent ``py.test`` run will use your local version - -Checkout customize_, other plugins_ or `get in contact`_. - -.. include:: links.txt diff --git a/doc/test/plugin/restdoc.txt b/doc/test/plugin/restdoc.txt deleted file mode 100644 index 62d407272..000000000 --- a/doc/test/plugin/restdoc.txt +++ /dev/null @@ -1,32 +0,0 @@ - -perform ReST syntax, local and remote reference tests on .rst/.txt files. -========================================================================= - - -.. contents:: - :local: - - - -command line options --------------------- - - -``-R, --urlcheck`` - urlopen() remote links found in ReST text files. -``--urltimeout=secs`` - timeout in seconds for remote urlchecks -``--forcegen`` - force generation of html files. - -Start improving this plugin in 30 seconds -========================================= - - -1. Download `pytest_restdoc.py`_ plugin source code -2. put it somewhere as ``pytest_restdoc.py`` into your import path -3. a subsequent ``py.test`` run will use your local version - -Checkout customize_, other plugins_ or `get in contact`_. - -.. include:: links.txt diff --git a/doc/test/plugin/resultlog.txt b/doc/test/plugin/resultlog.txt deleted file mode 100644 index f2cf2511d..000000000 --- a/doc/test/plugin/resultlog.txt +++ /dev/null @@ -1,31 +0,0 @@ - -non-xml machine-readable logging of test results. -================================================= - - -.. contents:: - :local: - -Useful for buildbot integration code. See the `PyPy-test`_ - web page for post-processing. - -.. _`PyPy-test`: http://codespeak.net:8099/summary - -command line options --------------------- - - -``--resultlog=path`` - path for machine-readable result log. - -Start improving this plugin in 30 seconds -========================================= - - -1. Download `pytest_resultlog.py`_ plugin source code -2. put it somewhere as ``pytest_resultlog.py`` into your import path -3. a subsequent ``py.test`` run will use your local version - -Checkout customize_, other plugins_ or `get in contact`_. - -.. include:: links.txt diff --git a/doc/test/plugin/tmpdir.txt b/doc/test/plugin/tmpdir.txt index 0e2fba51c..0a4566579 100644 --- a/doc/test/plugin/tmpdir.txt +++ b/doc/test/plugin/tmpdir.txt @@ -25,14 +25,3 @@ created as a sub directory of the base temporary directory. The returned object is a `py.path.local`_ path object. -Start improving this plugin in 30 seconds -========================================= - - -1. Download `pytest_tmpdir.py`_ plugin source code -2. put it somewhere as ``pytest_tmpdir.py`` into your import path -3. a subsequent ``py.test`` run will use your local version - -Checkout customize_, other plugins_ or `get in contact`_. - -.. include:: links.txt diff --git a/pytest/plugin/pytest_junitxml.py b/pytest/plugin/pytest_junitxml.py index 48b716f9d..bea439a25 100644 --- a/pytest/plugin/pytest_junitxml.py +++ b/pytest/plugin/pytest_junitxml.py @@ -1,5 +1,4 @@ -""" - logging of test results in JUnit-XML format, for use with Hudson +""" logging of test results in JUnit-XML format, for use with Hudson and build integration servers. Based on initial code from Ross Lawley. """ diff --git a/pytest/plugin/pytest_pastebin.py b/pytest/plugin/pytest_pastebin.py index 164457b33..52d7a65e6 100644 --- a/pytest/plugin/pytest_pastebin.py +++ b/pytest/plugin/pytest_pastebin.py @@ -1,24 +1,4 @@ -""" -submit failure or test session information to a pastebin service. - -Usage ----------- - -**Creating a URL for each test failure**:: - - py.test --pastebin=failed - -This will submit test run information to a remote Paste service and -provide a URL for each failure. You may select tests as usual or add -for example ``-x`` if you only want to send one particular failure. - -**Creating a URL for a whole test session log**:: - - py.test --pastebin=all - -Currently only pasting to the http://paste.pocoo.org service is implemented. - -""" +""" submit failure or test session information to a pastebin service. """ import py, sys class url: diff --git a/pytest/plugin/pytest_resultlog.py b/pytest/plugin/pytest_resultlog.py index 09b9213a2..b3685f291 100644 --- a/pytest/plugin/pytest_resultlog.py +++ b/pytest/plugin/pytest_resultlog.py @@ -1,10 +1,4 @@ -"""non-xml machine-readable logging of test results. - Useful for buildbot integration code. See the `PyPy-test`_ - web page for post-processing. - -.. _`PyPy-test`: http://codespeak.net:8099/summary - -""" +""" create machine readable plain text file with results. """ import py from py.builtin import print_