From 5156216871408e7c58543df50e9c9b1222a01651 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Fri, 31 Jul 2009 14:43:04 +0200 Subject: [PATCH] regen manifest, improve docs generation --HG-- branch : 1.0.x --- MANIFEST | 3 +++ doc/test/plugin/doctest.txt | 6 +----- doc/test/plugin/figleaf.txt | 6 +----- doc/test/plugin/hooklog.txt | 6 +----- doc/test/plugin/hookspec.txt | 9 +++++++++ doc/test/plugin/index.txt | 16 +--------------- doc/test/plugin/iocapture.txt | 6 +----- doc/test/plugin/keyword.txt | 6 +----- doc/test/plugin/links.txt | 33 +++++++++++++++++++++++++++++++++ doc/test/plugin/monkeypatch.txt | 6 +----- doc/test/plugin/pdb.txt | 6 +----- doc/test/plugin/pocoo.txt | 6 +----- doc/test/plugin/recwarn.txt | 6 +----- doc/test/plugin/restdoc.txt | 6 +----- doc/test/plugin/resultlog.txt | 6 +----- doc/test/plugin/terminal.txt | 6 +----- doc/test/plugin/unittest.txt | 6 +----- doc/test/plugin/xfail.txt | 6 +----- makepluginlist.py | 22 ++++++++++++++++++++-- 19 files changed, 80 insertions(+), 87 deletions(-) create mode 100644 doc/test/plugin/links.txt diff --git a/MANIFEST b/MANIFEST index 1a2c689ec..90fa7a29f 100644 --- a/MANIFEST +++ b/MANIFEST @@ -30,11 +30,14 @@ doc/test/features.txt doc/test/funcargs.txt doc/test/plugin/doctest.txt doc/test/plugin/figleaf.txt +doc/test/plugin/hooklog.txt doc/test/plugin/hookspec.txt doc/test/plugin/index.txt doc/test/plugin/iocapture.txt +doc/test/plugin/keyword.txt doc/test/plugin/monkeypatch.txt doc/test/plugin/oejskit.txt +doc/test/plugin/pdb.txt doc/test/plugin/pocoo.txt doc/test/plugin/recwarn.txt doc/test/plugin/restdoc.txt diff --git a/doc/test/plugin/doctest.txt b/doc/test/plugin/doctest.txt index fd4fb8f90..95d525b48 100644 --- a/doc/test/plugin/doctest.txt +++ b/doc/test/plugin/doctest.txt @@ -37,8 +37,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_doctest.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_doctest.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/figleaf.txt b/doc/test/plugin/figleaf.txt index e48be57ce..737b116ce 100644 --- a/doc/test/plugin/figleaf.txt +++ b/doc/test/plugin/figleaf.txt @@ -32,8 +32,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_figleaf.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_figleaf.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/hooklog.txt b/doc/test/plugin/hooklog.txt index 270b5bb02..4fb4d8f40 100644 --- a/doc/test/plugin/hooklog.txt +++ b/doc/test/plugin/hooklog.txt @@ -28,8 +28,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_hooklog.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_hooklog.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/hookspec.txt b/doc/test/plugin/hookspec.txt index 3a2cfecd7..bb78cdf11 100644 --- a/doc/test/plugin/hookspec.txt +++ b/doc/test/plugin/hookspec.txt @@ -92,6 +92,14 @@ hook specification sourcecode def pytest_runtest_logreport(rep): """ process item test report. """ + # special handling for final teardown - somewhat internal for now + def pytest__teardown_final(session): + """ called before test session finishes. """ + pytest__teardown_final.firstresult = True + + def pytest__teardown_final_logerror(rep): + """ called if runtest_teardown_final failed. """ + # ------------------------------------------------------------------------- # test session related hooks # ------------------------------------------------------------------------- @@ -163,3 +171,4 @@ hook specification sourcecode def pytest_trace(category, msg): """ called for debug info. """ +.. include:: links.txt diff --git a/doc/test/plugin/index.txt b/doc/test/plugin/index.txt index 4c8ea9615..f7e6cee6d 100644 --- a/doc/test/plugin/index.txt +++ b/doc/test/plugin/index.txt @@ -45,18 +45,4 @@ keyword_ mark test functions with keywords that may hold values. hooklog_ log invocations of extension hooks to a file. -.. _`xfail`: xfail.html -.. _`figleaf`: figleaf.html -.. _`monkeypatch`: monkeypatch.html -.. _`iocapture`: iocapture.html -.. _`recwarn`: recwarn.html -.. _`unittest`: unittest.html -.. _`doctest`: doctest.html -.. _`oejskit`: oejskit.html -.. _`restdoc`: restdoc.html -.. _`pocoo`: pocoo.html -.. _`resultlog`: resultlog.html -.. _`terminal`: terminal.html -.. _`pdb`: pdb.html -.. _`keyword`: keyword.html -.. _`hooklog`: hooklog.html +.. include:: links.txt diff --git a/doc/test/plugin/iocapture.txt b/doc/test/plugin/iocapture.txt index 7aefb0420..c3a01d658 100644 --- a/doc/test/plugin/iocapture.txt +++ b/doc/test/plugin/iocapture.txt @@ -128,8 +128,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_iocapture.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_iocapture.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/keyword.txt b/doc/test/plugin/keyword.txt index e6e640f9d..91756ac5b 100644 --- a/doc/test/plugin/keyword.txt +++ b/doc/test/plugin/keyword.txt @@ -43,8 +43,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_keyword.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_keyword.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/links.txt b/doc/test/plugin/links.txt new file mode 100644 index 000000000..157b91272 --- /dev/null +++ b/doc/test/plugin/links.txt @@ -0,0 +1,33 @@ +.. _`pytest_recwarn.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_recwarn.py +.. _`pytest_iocapture.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_iocapture.py +.. _`pytest_monkeypatch.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_monkeypatch.py +.. _`plugins`: index.html +.. _`pytest_doctest.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_doctest.py +.. _`terminal`: terminal.html +.. _`hooklog`: hooklog.html +.. _`pytest_restdoc.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_restdoc.py +.. _`xfail`: xfail.html +.. _`pytest_pocoo.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_pocoo.py +.. _`pytest_keyword.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_keyword.py +.. _`pytest_figleaf.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_figleaf.py +.. _`pytest_hooklog.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_hooklog.py +.. _`contact`: ../../contact.html +.. _`pocoo`: pocoo.html +.. _`checkout the py.test development version`: ../../download.html#checkout +.. _`oejskit`: oejskit.html +.. _`unittest`: unittest.html +.. _`iocapture`: iocapture.html +.. _`pytest_xfail.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_xfail.py +.. _`figleaf`: figleaf.html +.. _`extend`: ../extend.html +.. _`pytest_terminal.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_terminal.py +.. _`recwarn`: recwarn.html +.. _`pytest_pdb.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_pdb.py +.. _`monkeypatch`: monkeypatch.html +.. _`resultlog`: resultlog.html +.. _`keyword`: keyword.html +.. _`restdoc`: restdoc.html +.. _`pytest_unittest.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_unittest.py +.. _`doctest`: doctest.html +.. _`pytest_resultlog.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_resultlog.py +.. _`pdb`: pdb.html diff --git a/doc/test/plugin/monkeypatch.txt b/doc/test/plugin/monkeypatch.txt index 0d3e37528..b1f40a37c 100644 --- a/doc/test/plugin/monkeypatch.txt +++ b/doc/test/plugin/monkeypatch.txt @@ -58,8 +58,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_monkeypatch.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_monkeypatch.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/pdb.txt b/doc/test/plugin/pdb.txt index 26eefdca4..bea0f5084 100644 --- a/doc/test/plugin/pdb.txt +++ b/doc/test/plugin/pdb.txt @@ -28,8 +28,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_pdb.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_pdb.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/pocoo.txt b/doc/test/plugin/pocoo.txt index 187cb72de..c4c3b5d9a 100644 --- a/doc/test/plugin/pocoo.txt +++ b/doc/test/plugin/pocoo.txt @@ -28,8 +28,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_pocoo.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_pocoo.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/recwarn.txt b/doc/test/plugin/recwarn.txt index 40da066ce..98915f9d0 100644 --- a/doc/test/plugin/recwarn.txt +++ b/doc/test/plugin/recwarn.txt @@ -58,8 +58,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_recwarn.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_recwarn.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/restdoc.txt b/doc/test/plugin/restdoc.txt index 423c000ff..1e9d21bb8 100644 --- a/doc/test/plugin/restdoc.txt +++ b/doc/test/plugin/restdoc.txt @@ -32,8 +32,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_restdoc.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_restdoc.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/resultlog.txt b/doc/test/plugin/resultlog.txt index 0b0276088..8cdfd32ee 100644 --- a/doc/test/plugin/resultlog.txt +++ b/doc/test/plugin/resultlog.txt @@ -28,8 +28,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_resultlog.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_resultlog.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/terminal.txt b/doc/test/plugin/terminal.txt index a298cb8b0..ab6cde48c 100644 --- a/doc/test/plugin/terminal.txt +++ b/doc/test/plugin/terminal.txt @@ -21,8 +21,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_terminal.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_terminal.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/unittest.txt b/doc/test/plugin/unittest.txt index 857279d2d..68d245fca 100644 --- a/doc/test/plugin/unittest.txt +++ b/doc/test/plugin/unittest.txt @@ -31,8 +31,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_unittest.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_unittest.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/doc/test/plugin/xfail.txt b/doc/test/plugin/xfail.txt index 48bd01abc..4764a224d 100644 --- a/doc/test/plugin/xfail.txt +++ b/doc/test/plugin/xfail.txt @@ -33,8 +33,4 @@ Do you find the above documentation or the plugin itself lacking? Further information: extend_ documentation, other plugins_ or contact_. -.. _`pytest_xfail.py`: http://bitbucket.org/hpk42/py-trunk/raw/6e9879aca934933c6065776820f22095634a7edf/py/test/plugin/pytest_xfail.py -.. _`extend`: ../extend.html -.. _`plugins`: index.html -.. _`contact`: ../../contact.html -.. _`checkout the py.test development version`: ../../download.html#checkout +.. include:: links.txt diff --git a/makepluginlist.py b/makepluginlist.py index d88c9584b..70bd69faa 100644 --- a/makepluginlist.py +++ b/makepluginlist.py @@ -28,6 +28,8 @@ def warn(*args): print >>sys.stderr, "WARN:", msg class RestWriter: + _all_links = {} + def __init__(self, target): self.target = py.path.local(target) self.links = [] @@ -92,9 +94,23 @@ class RestWriter: def write_links(self): self.Print() + self.Print(".. include:: links.txt") for link in self.links: - #warn(repr(self.link)) - self.Print(".. _`%s`: %s" % (link[0], link[1])) + key = link[0] + if key in self._all_links: + assert self._all_links[key] == link[1], (key, link[1]) + else: + self._all_links[key] = link[1] + + def write_all_links(cls, linkpath): + p = linkpath.new(basename="links.txt") + p_writer = RestWriter(p) + p_writer.out = p_writer.target.open("w") + for name, value in cls._all_links.items(): + p_writer.Print(".. _`%s`: %s" % (name, value)) + p_writer.out.close() + del p_writer.out + write_all_links = classmethod(write_all_links) def make(self, **kwargs): self.out = self.target.open("w") @@ -266,3 +282,5 @@ if __name__ == "__main__": ov = HookSpec(testdir.join("plugin", "hookspec.txt")) ov.make(config=_config) + RestWriter.write_all_links(testdir.join("plugin", "links.txt")) +