From d4f507307655b070b39e52be5e772e6b518f5b26 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 13 Jan 2010 00:47:20 +0100 Subject: [PATCH] remove figleaf which now lives "outside" --HG-- branch : trunk --- bin-for-dist/makepluginlist.py | 3 +- doc/test/plugin/figleaf.txt | 32 ++++------------ doc/test/plugin/helpconfig.txt | 6 +++ doc/test/plugin/hookspec.txt | 3 ++ doc/test/plugin/index.txt | 10 ++--- doc/test/plugin/links.txt | 5 +-- doc/test/plugin/terminal.txt | 6 --- py/plugin/pytest_figleaf.py | 54 --------------------------- testing/plugin/test_pytest_figleaf.py | 17 --------- 9 files changed, 26 insertions(+), 110 deletions(-) delete mode 100644 py/plugin/pytest_figleaf.py delete mode 100644 testing/plugin/test_pytest_figleaf.py diff --git a/bin-for-dist/makepluginlist.py b/bin-for-dist/makepluginlist.py index 109d5cdb8..8e9fc3713 100644 --- a/bin-for-dist/makepluginlist.py +++ b/bin-for-dist/makepluginlist.py @@ -22,6 +22,7 @@ plugins = [ externals = { 'oejskit': "run javascript tests in real life browsers", + 'figleaf': "for testing with Titus' figleaf coverage module", 'django': "for testing django applications", 'coverage': "for testing with Ned's coverage module ", 'xmlresult': "for generating xml reports " @@ -137,7 +138,7 @@ class PluginOverview(RestWriter): docpath = self.target.dirpath(name).new(ext=".txt") if oneliner is not None: htmlpath = docpath.new(ext='.html') - self.para("%s_ (3rd) %s" %(name, oneliner)) + self.para("%s_ (external) %s" %(name, oneliner)) self.add_internal_link(name, htmlpath) else: doc = PluginDoc(docpath) diff --git a/doc/test/plugin/figleaf.txt b/doc/test/plugin/figleaf.txt index af265cd84..4d13ebb99 100644 --- a/doc/test/plugin/figleaf.txt +++ b/doc/test/plugin/figleaf.txt @@ -1,33 +1,17 @@ - pytest_figleaf plugin ===================== -report python test coverage using the 'figleaf' package. +add options to drive and report python test coverage using the 'figleaf' package. -.. contents:: - :local: +Install the `pytest-figleaf`_ plugin to use figleaf coverage testing:: -Not enabled by default (use "-p" or conftest settings to do so). + easy_install pytest-figleaf -command line options --------------------- +or:: + + pip install pytest-figleaf +This will make py.test have figleaf related options. -``--figleaf`` - trace python coverage with figleaf and write HTML for files below the current working dir -``--fig-data=dir`` - set tracing file, default: ".figleaf". -``--fig-html=dir`` - set html reporting dir, default "html". +.. _`pytest-figleaf`: http://bitbucket.org/hpk42/pytest-figleaf/ -Start improving this plugin in 30 seconds -========================================= - - -1. Download `pytest_figleaf.py`_ plugin source code -2. put it somewhere as ``pytest_figleaf.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/helpconfig.txt b/doc/test/plugin/helpconfig.txt index 0f71160e0..6ab7818cf 100644 --- a/doc/test/plugin/helpconfig.txt +++ b/doc/test/plugin/helpconfig.txt @@ -17,6 +17,12 @@ command line options display py lib version and import information. ``-p name`` early-load given plugin (multi-allowed). +``--traceconfig`` + trace considerations of conftest.py files. +``--nomagic`` + don't reinterpret asserts, no traceback cutting. +``--debug`` + generate and show internal debugging information. ``--help-config`` show available conftest.py and ENV-variable names. diff --git a/doc/test/plugin/hookspec.txt b/doc/test/plugin/hookspec.txt index 4279250ab..bbfe81055 100644 --- a/doc/test/plugin/hookspec.txt +++ b/doc/test/plugin/hookspec.txt @@ -115,6 +115,9 @@ hook specification sourcecode # hooks for influencing reporting (invoked from pytest_terminal) # ------------------------------------------------------------------------- + def pytest_report_header(config): + """ return a string to be displayed as header info for terminal reporting.""" + def pytest_report_teststatus(report): """ return result-category, shortletter and verbose word for reporting.""" pytest_report_teststatus.firstresult = True diff --git a/doc/test/plugin/index.txt b/doc/test/plugin/index.txt index 2b3d35103..413ce77b6 100644 --- a/doc/test/plugin/index.txt +++ b/doc/test/plugin/index.txt @@ -8,9 +8,9 @@ mark_ generic mechanism for marking python functions. pdb_ interactive debugging with the Python Debugger. -figleaf_ report python test coverage using the 'figleaf' package. +figleaf_ (external) for testing with Titus' figleaf coverage module -coverage_ (3rd) for testing with Ned's coverage module +coverage_ (external) for testing with Ned's coverage module monkeypatch_ safely patch object attributes, dicts and environment variables. @@ -24,9 +24,9 @@ tmpdir_ provide temporary directories to test functions. testing domains =============== -oejskit_ (3rd) run javascript tests in real life browsers +oejskit_ (external) run javascript tests in real life browsers -django_ (3rd) for testing django applications +django_ (external) for testing django applications genscript_ generate standalone test script to be distributed along with an application. @@ -38,7 +38,7 @@ pastebin_ submit failure or test session information to a pastebin service. logxml_ logging of test results in JUnit-XML format, for use with Hudson -xmlresult_ (3rd) for generating xml reports and CruiseControl integration +xmlresult_ (external) for generating xml reports and CruiseControl integration resultlog_ non-xml machine-readable logging of test results. diff --git a/doc/test/plugin/links.txt b/doc/test/plugin/links.txt index a643dc8da..cea5f9c49 100644 --- a/doc/test/plugin/links.txt +++ b/doc/test/plugin/links.txt @@ -1,5 +1,5 @@ .. _`pytest_logxml.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_logxml.py -.. _`terminal`: terminal.html +.. _`helpconfig`: helpconfig.html .. _`pytest_recwarn.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_recwarn.py .. _`unittest`: unittest.html .. _`pytest_monkeypatch.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_monkeypatch.py @@ -17,10 +17,9 @@ .. _`restdoc`: restdoc.html .. _`pytest_pastebin.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_pastebin.py .. _`pytest_tmpdir.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_tmpdir.py -.. _`pytest_figleaf.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_figleaf.py +.. _`terminal`: terminal.html .. _`pytest_hooklog.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_hooklog.py .. _`logxml`: logxml.html -.. _`helpconfig`: helpconfig.html .. _`pytest_skipping.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_skipping.py .. _`checkout the py.test development version`: ../../install.html#checkout .. _`pytest_helpconfig.py`: http://bitbucket.org/hpk42/py-trunk/raw/1.2.0a1/py/plugin/pytest_helpconfig.py diff --git a/doc/test/plugin/terminal.txt b/doc/test/plugin/terminal.txt index 14b662b6a..12abef493 100644 --- a/doc/test/plugin/terminal.txt +++ b/doc/test/plugin/terminal.txt @@ -23,12 +23,6 @@ command line options traceback verboseness (long/short/no). ``--fulltrace`` don't cut any tracebacks (default is to cut). -``--traceconfig`` - trace considerations of conftest.py files. -``--nomagic`` - don't reinterpret asserts, no traceback cutting. -``--debug`` - generate and show internal debugging information. Start improving this plugin in 30 seconds ========================================= diff --git a/py/plugin/pytest_figleaf.py b/py/plugin/pytest_figleaf.py deleted file mode 100644 index e45a2b625..000000000 --- a/py/plugin/pytest_figleaf.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -report python test coverage using the 'figleaf' package. - -Not enabled by default (use "-p" or conftest settings to do so). -""" -import py -py.test.importorskip("figleaf") -import figleaf.annotate_html - -def pytest_addoption(parser): - group = parser.getgroup('figleaf options') - group.addoption('--figleaf', action='store_true', default=False, - dest = 'figleaf', - help=('trace python coverage with figleaf and write HTML ' - 'for files below the current working dir')) - group.addoption('--fig-data', action='store', default='.figleaf', - dest='figleafdata', metavar="dir", - help='set tracing file, default: ".figleaf".') - group.addoption('--fig-html', action='store', default='html', - dest='figleafhtml', metavar="dir", - help='set html reporting dir, default "html".') - -def pytest_configure(config): - if config.getvalue("figleaf"): - figleaf.start() - -def pytest_terminal_summary(terminalreporter): - config = terminalreporter.config - if not config.getvalue("figleaf"): - return - datafile = py.path.local(config.getvalue('figleafdata')) - tw = terminalreporter._tw - tw.sep('-', 'figleaf') - tw.line('Writing figleaf data to %s' % (datafile)) - figleaf.stop() - figleaf.write_coverage(str(datafile)) - coverage = get_coverage(datafile, config) - reportdir = py.path.local(config.getvalue('figleafhtml')) - tw.line('Writing figleaf html to file://%s' % (reportdir)) - figleaf.annotate_html.prepare_reportdir(str(reportdir)) - exclude = [] - figleaf.annotate_html.report_as_html(coverage, - str(reportdir), exclude, {}) - -def get_coverage(datafile, config): - # basepath = config.topdir - basepath = py.path.local() - data = figleaf.read_coverage(str(datafile)) - d = {} - coverage = figleaf.combine_coverage(d, data) - for path in coverage.keys(): - if not py.path.local(path).relto(basepath): - del coverage[path] - return coverage diff --git a/testing/plugin/test_pytest_figleaf.py b/testing/plugin/test_pytest_figleaf.py deleted file mode 100644 index bfc86f047..000000000 --- a/testing/plugin/test_pytest_figleaf.py +++ /dev/null @@ -1,17 +0,0 @@ -import py - -def test_functional(testdir): - py.test.importorskip("figleaf") - testdir.makepyfile(""" - def f(): - x = 42 - def test_whatever(): - pass - """) - result = testdir.runpytest('--figleaf') - assert result.ret == 0 - assert result.stdout.fnmatch_lines([ - '*figleaf html*' - ]) - #print result.stdout.str() -