[Checkins] SVN: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/test Add tests for new all-in-one setup.

Uli Fouquet uli at gnufix.de
Sun Feb 3 04:09:53 EST 2008


Log message for revision 83447:
  Add tests for new all-in-one setup.

Changed:
  U   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/testrunner.txt
  A   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/cave/samplesetup_short0.py

-=-
Modified: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/testrunner.txt
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/testrunner.txt	2008-02-03 09:09:02 UTC (rev 83446)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/testrunner.txt	2008-02-03 09:09:53 UTC (rev 83447)
@@ -14,6 +14,41 @@
 
     >>> import os
     >>> cavepath = os.path.join(os.path.dirname(__file__), 'tests', 'cave')
+    >>> setupfile = os.path.join(cavepath, 'samplesetup_short0.py')
+    >>> print open(setupfile).read()
+    import z3c.testsetup
+    test_suite = z3c.testsetup.register_all_tests('z3c.testsetup.tests.cave')
+
+This means, that we want to register all tests (doctests and 'normal'
+python tests) from the ``cave`` package, whose name we passed in
+dotted name notation as a string. This is enough information for a
+testrunner::
+
+    >>> import sys
+    >>> defaults = [
+    ...     '--path', cavepath,
+    ...     '--tests-pattern', '^samplesetup_short0$',
+    ...     ]
+    >>> sys.argv = 'test '.split()
+    >>> from zope.testing import testrunner
+    >>> testrunner.run(defaults)
+    Running unit tests:
+      Ran 2 tests with 0 failures and 0 errors in ... seconds.
+    Running z3c.testsetup.doctesting.FunctionalLayer tests:
+      Set up z3c.testsetup.doctesting.FunctionalLayer in ... seconds.
+      Ran 2 tests with 0 failures and 0 errors in ... seconds.
+    Tearing down left over layers:
+      Tear down z3c.testsetup.doctesting.FunctionalLayer ... not supported
+    Total: 4 tests, 0 failures, 0 errors in ... seconds.
+    False
+
+Of the four tests apparently run, there is one 'normal' python test
+and three doctests, of which two are functional doctests.
+
+Now, we only want to run the doctests in the ``cave`` package. A
+suitable setup is contained in `samplesetup_short1.py`` in the
+``cave`` package::
+
     >>> setupfile = os.path.join(cavepath, 'samplesetup_short1.py')
     >>> print open(setupfile).read()
     import z3c.testsetup

Added: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/cave/samplesetup_short0.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/cave/samplesetup_short0.py	                        (rev 0)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/cave/samplesetup_short0.py	2008-02-03 09:09:53 UTC (rev 83447)
@@ -0,0 +1,2 @@
+import z3c.testsetup
+test_suite = z3c.testsetup.register_all_tests('z3c.testsetup.tests.cave')



More information about the Checkins mailing list