devtools/testlib.py
branchstable
changeset 6687 0b1f5c14646e
parent 6631 26c303c3f1aa
child 6694 d9eac4fd57dc
--- a/devtools/testlib.py	Fri Nov 05 16:38:17 2010 +0100
+++ b/devtools/testlib.py	Fri Nov 05 15:08:24 2010 +0100
@@ -661,6 +661,13 @@
 
     # content validation #######################################################
 
+    def assertDocTestFile(self, testfile):
+        # doctest returns tuple (failure_count, test_count)
+        result = self.shell.process_script(testfile)
+        if result[0] and result[1]:
+            raise self.failureException("doctest file '%s' failed"
+                                        % testfile)
+
     # validators are used to validate (XML, DTD, whatever) view's content
     # validators availables are :
     #  DTDValidator : validates XML + declared DTD