Changeset 12595 for main/waeup.kofa/trunk/src/waeup/kofa/browser
- Timestamp:
- 11 Feb 2015, 15:28:49 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_async.py
r12581 r12595 3 3 import tempfile 4 4 import transaction 5 from contextlib import contextmanager6 5 from zc.async.testing import wait_for_result 7 6 from zope.component import getUtility … … 12 11 from waeup.kofa.async import AsyncJob, get_job_id 13 12 from waeup.kofa.interfaces import IJobManager, IKofaUtils 14 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 13 from waeup.kofa.testing import ( 14 FunctionalTestCase, FunctionalLayer, expensive_actions, 15 ) 15 16 from waeup.kofa.tests.test_async import FunctionalAsyncTestCase 16 17 … … 22 23 def dummy_func(): 23 24 return 42 24 25 26 @contextmanager27 def expensive_actions():28 """A contextmanager to work with a modified `expensive_acrtions_allowed()`29 30 This method is part of local IKofaUtils.31 """32 utils = getUtility(IKofaUtils)33 old_func = utils.expensive_actions_allowed34 try:35 yield utils36 finally:37 # restore function after use38 utils.expensive_actions_allowed = old_func39 25 40 26
Note: See TracChangeset for help on using the changeset viewer.