[tor-commits] [bridgedb/master] Turn doctest we skip in bridgedb.test.util into a Sphinx codeblock.

isis at torproject.org isis at torproject.org
Sun Jan 12 06:06:35 UTC 2014


commit 496bd0feacf5a2d426790fb3c386a1208dc43e3a
Author: Isis Lovecruft <isis at torproject.org>
Date:   Fri Dec 20 07:34:51 2013 +0000

    Turn doctest we skip in bridgedb.test.util into a Sphinx codeblock.
    
    It was still failing.
---
 lib/bridgedb/test/util.py |   40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

diff --git a/lib/bridgedb/test/util.py b/lib/bridgedb/test/util.py
index a8c6903..a012597 100644
--- a/lib/bridgedb/test/util.py
+++ b/lib/bridgedb/test/util.py
@@ -23,23 +23,29 @@ from functools import wraps
 def fileCheckDecorator(func):
     """Method decorator for a t.t.unittest.TestCase test_* method.
 
-    >>> import shutil  # doctest: +SKIP
-    >>> from twisted.trial import unittest
-    >>> pyunit = __import__('unittest')
-    >>> class TestTests(unittest.TestCase):
-    ...     @fileCheckDecorator
-    ...     def doCopyFile(src, dst, description=None):
-    ...         shutil.copy(src, dst)
-    ...     def test_doCopyFile(self):
-    ...         srcfile = self.mktemp()
-    ...         dstfile = self.mktemp()
-    ...         with open(srcfile, 'wb') as fh:
-    ...             fh.write('testing TestCase method decorator utility')
-    ...             fh.flush()
-    ...         self.doCopyFile(srcfile, dstfile, 'asparagus')
-    ...
-    >>> testtest = TestTests()
-    >>> testtest.runTest()
+    .. codeblock:: python
+
+        import shutil
+        from twisted.trial import unittest
+
+        pyunit = __import__('unittest')
+
+        class TestTests(unittest.TestCase):
+            @fileCheckDecorator
+            def doCopyFile(src, dst, description=None):
+                shutil.copy(src, dst)
+            def test_doCopyFile(self):
+                srcfile = self.mktemp()
+                dstfile = self.mktemp()
+                with open(srcfile, 'wb') as fh:
+                    fh.write('testing TestCase method decorator utility')
+                    fh.flush()
+                self.doCopyFile(srcfile, dstfile, 'asparagus')
+
+        testtest = TestTests()
+        testtest.runTest()
+
+    ..
 
     :type func: callable
     :param func: The ``test_*`` method, from a





More information about the tor-commits mailing list