[Checkins] SVN: Sandbox/ulif/z3c-testsetup/trunk/s Fix tests.

Uli Fouquet uli at gnufix.de
Thu Jan 31 20:09:10 EST 2008


Log message for revision 83369:
  Fix tests.

Changed:
  U   Sandbox/ulif/z3c-testsetup/trunk/setup.py
  U   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/__init__.py
  U   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/basicsetup.py
  U   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/functionalsetup.py
  U   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/test_testsetup.py
  U   Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/unittestsetup.py

-=-
Modified: Sandbox/ulif/z3c-testsetup/trunk/setup.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/setup.py	2008-02-01 00:51:20 UTC (rev 83368)
+++ Sandbox/ulif/z3c-testsetup/trunk/setup.py	2008-02-01 01:09:09 UTC (rev 83369)
@@ -35,6 +35,7 @@
     include_package_data = True,
     zip_safe=False,
     install_requires=['setuptools',
+                      'zope.component',
                       'zope.testing',
                       'zope.app.testing',
                       ],

Modified: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/__init__.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/__init__.py	2008-02-01 00:51:20 UTC (rev 83368)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/__init__.py	2008-02-01 01:09:09 UTC (rev 83369)
@@ -1 +1,3 @@
-# Make this a package
+from z3c.testsetup.testing import (BasicTestSetup, UnitTestSetup,
+                                   FunctionalTestSetup)
+

Modified: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/basicsetup.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/basicsetup.py	2008-02-01 00:51:20 UTC (rev 83368)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/basicsetup.py	2008-02-01 01:09:09 UTC (rev 83369)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2008 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -16,33 +16,30 @@
 Basic Test Setup
 ================
 
-``BasicTestSetup`` is a class to support easier setup of tests in grok
-projects. It acts merely as a container for shared functions, methods
-and attributes needed by 'real' test setups which are derived from
-it. Itself provides *no* ``getTestSuite()`` method, which is needed to
-setup real tests.
+``BasicTestSetup`` is a class to support easier setup of tests in Zope
+3 projects. It acts merely as a container for shared functions,
+methods and attributes needed by 'real' test setups which are derived
+from it. Itself provides *no* ``getTestSuite()`` method, which is
+needed to setup real tests.
 
 A ``BasicTestSetup`` tries to find all doctest files defined in a given
 package. See `functionalsetup.py` for setting up real functional tests
 and `unittestsetup.py` for 'real' setup of unittests.
 
-For a general introduction into testing with grok see the appropriate
-howto on the grok homepage.
-
 The TestSetup classes all search and handle doctest files.
 
 All we need to setup a testsuite, is the package to search::
 
-   >>> from grok.tests.testsetup import cave
-   >>> from grok.testing import BasicTestSetup
+   >>> from z3c.testsetup.tests import cave
+   >>> from z3c.testsetup import BasicTestSetup
    >>> basic_setup = BasicTestSetup(cave)
    >>> basic_setup
-   <grok.testing.BasicTestSetup object at 0x...>
+   <z3c.testsetup.testing.BasicTestSetup object at 0x...>
 
 The package is stored as an instance-attribute::
 
    >>> basic_setup.package
-   <module 'grok.tests.testsetup.cave' from ...>
+   <module 'z3c.testsetup.tests.cave' from ...>
 
 The ``BasicTestSetup`` serves merely as a container for attributes and
 methods needed by derived classes, that provide proper test setup.

Modified: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/functionalsetup.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/functionalsetup.py	2008-02-01 00:51:20 UTC (rev 83368)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/functionalsetup.py	2008-02-01 01:09:09 UTC (rev 83369)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2008 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -42,14 +42,14 @@
 package. This has to be imported first, because we need the package as
 a parameter for the testseupt constructor::
 
-   >>> from grok.tests.testsetup import cave
+   >>> from z3c.testsetup.tests import cave
 
 Using the ``FunctionalTestSetup`` then is easy::
 
-   >>> from grok.testing import FunctionalTestSetup
+   >>> from z3c.testsetup import FunctionalTestSetup
    >>> setup = FunctionalTestSetup(cave)
    >>> setup
-   <grok.testing.FunctionalTestSetup object at 0x...>   
+   <z3c.testsetup.testing.FunctionalTestSetup object at 0x...>   
 
 This setup is ready for use::
 
@@ -124,7 +124,7 @@
   
      >>> setup.setUp
      <bound method FunctionalTestSetup.setUp of
-      <grok.testing.FunctionalTestSetup object at 0x...>>
+      <z3c.testsetup.testing.FunctionalTestSetup object at 0x...>>
 
 * The setup-instance's `globs` attribute is passed as the `globs`
   parameter. By default `globs` is a dictionary of functions, that

Modified: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/test_testsetup.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/test_testsetup.py	2008-02-01 00:51:20 UTC (rev 83368)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/test_testsetup.py	2008-02-01 01:09:09 UTC (rev 83369)
@@ -21,14 +21,6 @@
 
 def suiteFromFile(filename):
     suite = unittest.TestSuite()
-
-    if not filename.endswith('.py'):
-        continue
-    if filename.endswith('_fixture.py'):
-        continue
-    if filename == '__init__.py':
-        continue
-
     dottedname = 'z3c.testsetup.tests.%s' % (filename[:-3],)
     test = doctest.DocTestSuite(dottedname,
                                 setUp=setUpZope,

Modified: Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/unittestsetup.py
===================================================================
--- Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/unittestsetup.py	2008-02-01 00:51:20 UTC (rev 83368)
+++ Sandbox/ulif/z3c-testsetup/trunk/src/z3c/testsetup/tests/unittestsetup.py	2008-02-01 01:09:09 UTC (rev 83369)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2008 Zope Corporation and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -42,14 +42,14 @@
 package. This has to be imported first, because we need the package as
 a parameter for the testseupt constructor::
 
-   >>> from grok.tests.testsetup import cave
+   >>> from z3c.testsetup.tests import cave
 
 Using the ``UnitTestSetup`` then is easy::
 
-   >>> from grok.testing import UnitTestSetup
+   >>> from z3c.testsetup import UnitTestSetup
    >>> setup = UnitTestSetup(cave)
    >>> setup
-   <grok.testing.UnitTestSetup object at 0x...>   
+   <z3c.testsetup.testing.UnitTestSetup object at 0x...>   
 
 This setup is ready for use::
 
@@ -124,7 +124,7 @@
   
      >>> setup.setUp
      <bound method UnitTestSetup.setUp of
-      <grok.testing.UnitTestSetup object at 0x...>>
+      <z3c.testsetup.testing.UnitTestSetup object at 0x...>>
 
 * The setup-instance's `optionsflags` attribute is passed. It
   includes by default the following doctest constants:



More information about the Checkins mailing list