[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 496bd0feacf5a2d426790fb3c386a1208dc43e3a
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
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



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits