changeset 4028:5c78ac77c98f

tests: minor cleanups, remove unused code, fix (c)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 24 Aug 2008 16:01:27 +0200
parents 0d6724b87856
children 3d5c4ebe8f34
files MoinMoin/config/_tests/test_configs.py MoinMoin/conftest.py
diffstat 2 files changed, 6 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/_tests/test_configs.py	Sun Aug 24 02:01:34 2008 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-from MoinMoin.config.multiconfig import DefaultConfig
-
-class NoUnderlay(DefaultConfig):
-    data_underlay_dir = None
-
-_tests = [NoUnderlay, ]
-
-class TestConfigs:
-    def testConfigs(self):
-        for cls in _tests:
-            cls.data_dir = self.request.cfg.data_dir
-            cls.secrets = self.request.cfg.secrets
-            # quite a bad hack to make _importPlugin succeed
-            cls('MoinMoin')
--- a/MoinMoin/conftest.py	Sun Aug 24 02:01:34 2008 +0200
+++ b/MoinMoin/conftest.py	Sun Aug 24 16:01:27 2008 +0200
@@ -13,32 +13,28 @@
 
 Tests that require a certain configuration, like section_numbers = 1, must
 use a TestConfig to create the required configuration before the test.
-Deleting the TestConfig instance will restore the previous configuration.
 
-@copyright: 2005 Nir Soffer, 2007 Alexander Schremmer
+@copyright: 2005 MoinMoin:NirSoffer,
+            2007 MoinMoin:AlexanderSchremmer,
+            2008 MoinMoin:ThomasWaldmann
 @license: GNU GPL, see COPYING for details.
 """
 
 import atexit
-from sys import modules
 import sys
 
 import py
 
-
 rootdir = py.magic.autopath().dirpath()
 moindir = rootdir.join("..")
-
 sys.path.insert(0, str(moindir))
-from MoinMoin._tests import maketestwiki, compat, wikiconfig
-modules["unittest"] = compat # evil hack
-
 
 from MoinMoin.support.python_compatibility import set
+from MoinMoin._tests import maketestwiki, compat, wikiconfig
+sys.modules["unittest"] = compat # evil hack
 
 coverage_modules = set()
 
-
 try:
     """
     This code adds support for coverage.py (see
@@ -51,7 +47,7 @@
 
     def report_coverage():
         coverage.stop()
-        module_list = [modules[mod] for mod in coverage_modules]
+        module_list = [sys.modules[mod] for mod in coverage_modules]
         module_list.sort()
         coverage.report(module_list)