From e8d1cccd59a14811965fee27f75529acb5cd1c2c Mon Sep 17 00:00:00 2001 From: "Guido A.J. Stevens" Date: Fri, 10 Jul 2015 11:19:34 +0000 Subject: [PATCH] improve test isolation --- src/plone/app/theming/tests/test_policy.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plone/app/theming/tests/test_policy.py b/src/plone/app/theming/tests/test_policy.py index 258f5c4d..c23f926b 100644 --- a/src/plone/app/theming/tests/test_policy.py +++ b/src/plone/app/theming/tests/test_policy.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- import time -import multiprocessing import threading import transaction import unittest2 as unittest @@ -16,10 +15,16 @@ class TestFunctional(unittest.TestCase): layer = THEMING_FUNCTIONAL_TESTING + def setUp(self): + request = self.layer['request'] + policy = theming_policy(request) + # avoid cache pollution from other tests + policy.invalidateCache() + def tearDown(self): request = self.layer['request'] policy = theming_policy(request) - # static class attribute is cached across test runs + # clear local thread caches policy.invalidateCache() def test_getSettings(self):