[Checkins] SVN: lovely.tag/trunk/src/lovely/tag/ soft depend on z3c.sampledata

Bernd Dorn bernd.dorn at lovelysystems.com
Thu Mar 8 05:19:54 EST 2007


Log message for revision 73060:
  soft depend on z3c.sampledata

Changed:
  U   lovely.tag/trunk/src/lovely/tag/ftests.py
  U   lovely.tag/trunk/src/lovely/tag/tests.py

-=-
Modified: lovely.tag/trunk/src/lovely/tag/ftests.py
===================================================================
--- lovely.tag/trunk/src/lovely/tag/ftests.py	2007-03-08 10:15:51 UTC (rev 73059)
+++ lovely.tag/trunk/src/lovely/tag/ftests.py	2007-03-08 10:19:54 UTC (rev 73060)
@@ -1,6 +1,12 @@
 import unittest
 from zope.app.testing import functional
 
+try:
+    from z3c import sampledata
+    sampledata = True
+except ImportError:
+    sampledata = False
+
 functional.defineLayer('TestLayer', 'ftesting.zcml')
 
 
@@ -15,10 +21,12 @@
 
 def test_suite():
     suite = unittest.TestSuite()
+    if not sampledata:
+        return suite
     suites = (
         functional.FunctionalDocFileSuite('browser/README.txt',
                                           setUp=setUp, tearDown=tearDown,
-                                         ),
+                                          ),
         )
     for s in suites:
         s.layer=TestLayer

Modified: lovely.tag/trunk/src/lovely/tag/tests.py
===================================================================
--- lovely.tag/trunk/src/lovely/tag/tests.py	2007-03-08 10:15:51 UTC (rev 73059)
+++ lovely.tag/trunk/src/lovely/tag/tests.py	2007-03-08 10:19:54 UTC (rev 73060)
@@ -22,7 +22,13 @@
 from zope.app.testing import setup
 from zope.testing.doctestunit import DocFileSuite
 
+try:
+    from z3c import sampledata
+    sampledata = True
+except ImportError:
+    sampledata = False
 
+
 def setUp(test):
     setup.placefulSetUp()
 
@@ -37,7 +43,7 @@
         optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)
     stressSuite.level = 2
 
-    return unittest.TestSuite(
+    suite = unittest.TestSuite(
         (
         DocFileSuite('README.txt',
                      setUp=setUp,
@@ -45,8 +51,12 @@
                      optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS,
                      ),
         DocFileSuite('index.txt',),
-        stressSuite
+
         ))
 
+    if sampledata:
+        suite.addTest(stressSuite)
+    return suite
+
 if __name__ == '__main__':
     unittest.main(defaultTest='test_suite')



More information about the Checkins mailing list