Commit 991f3944 authored by Stefan H. Holek's avatar Stefan H. Holek

Startup tests left a tainted Products.__path__.

parent 91f052e8
...@@ -26,6 +26,7 @@ from ZConfig.components.logger.tests import test_logger ...@@ -26,6 +26,7 @@ from ZConfig.components.logger.tests import test_logger
from ZConfig.components.logger.loghandler import NullHandler from ZConfig.components.logger.loghandler import NullHandler
import Zope2.Startup import Zope2.Startup
import Products
from App.config import getConfiguration, setConfiguration from App.config import getConfiguration, setConfiguration
...@@ -63,6 +64,8 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase): ...@@ -63,6 +64,8 @@ class ZopeStarterTestCase(test_logger.LoggingTestBase):
os.rmdir(TEMPNAME) os.rmdir(TEMPNAME)
except: except:
pass pass
Products.__path__ = [d for d in Products.__path__
if os.path.exists(d)]
test_logger.LoggingTestBase.tearDown(self) test_logger.LoggingTestBase.tearDown(self)
# reset logger states # reset logger states
for name in (None, 'access', 'trace'): for name in (None, 'access', 'trace'):
......
...@@ -21,6 +21,7 @@ import unittest ...@@ -21,6 +21,7 @@ import unittest
import ZConfig import ZConfig
import Zope2.Startup import Zope2.Startup
import Products
from Zope2.Startup import datatypes from Zope2.Startup import datatypes
...@@ -43,6 +44,10 @@ class StartupTestCase(unittest.TestCase): ...@@ -43,6 +44,10 @@ class StartupTestCase(unittest.TestCase):
if self.schema is None: if self.schema is None:
StartupTestCase.schema = getSchema() StartupTestCase.schema = getSchema()
def tearDown(self):
Products.__path__ = [d for d in Products.__path__
if os.path.exists(d)]
def load_config_text(self, text): def load_config_text(self, text):
# We have to create a directory of our own since the existence # We have to create a directory of our own since the existence
# of the directory is checked. This handles this in a # of the directory is checked. This handles this in a
......
...@@ -23,6 +23,7 @@ import warnings ...@@ -23,6 +23,7 @@ import warnings
import ZConfig import ZConfig
import Zope2.Startup import Zope2.Startup
import Products
from Zope2.Startup import datatypes from Zope2.Startup import datatypes
...@@ -52,6 +53,8 @@ class TestWarnFilter(unittest.TestCase): ...@@ -52,6 +53,8 @@ class TestWarnFilter(unittest.TestCase):
def tearDown(self): def tearDown(self):
warnings.filters[:] = self.original_warning_filters warnings.filters[:] = self.original_warning_filters
Products.__path__ = [d for d in Products.__path__
if os.path.exists(d)]
def load_config_text(self, text): def load_config_text(self, text):
# We have to create a directory of our own since the existence # We have to create a directory of our own since the existence
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment