From 2612de2f38094f3c04ebf991f1ca84b02bf5ae3f Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 3 Jul 2016 17:10:36 -0700 Subject: Show testsetup code in rendered docs. For `testsetup`, Sphinx does not show code in the output: http://www.sphinx-doc.org/en/stable/ext/doctest.html#directive-testsetup This commit fixes that issue, although duplicates code. I'll submit a feature request to https://github.com/sphinx-doc/sphinx/ Fixes #2670 --- pyramid/decorator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pyramid/decorator.py b/pyramid/decorator.py index ea518bfcb..e3a8c707f 100644 --- a/pyramid/decorator.py +++ b/pyramid/decorator.py @@ -8,6 +8,16 @@ class reify(object): replacing the function it decorates with an instance variable. It is, in Python parlance, a non-data descriptor. An example: + .. code-block:: python + + from pyramid.decorator import reify + + class Foo(object): + @reify + def jammy(self): + print('jammy called') + return 1 + .. testsetup:: from pyramid.decorator import reify -- cgit v1.2.3