本文整理汇总了Python中zope.app.testing.placelesssetup.tearDown函数的典型用法代码示例。如果您正苦于以下问题:Python tearDown函数的具体用法?Python tearDown怎么用?Python tearDown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tearDown函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: tearDown
def tearDown(test):
placelesssetup.tearDown(test)
module.tearDown(test)
testing.cleanDB(test.globs['conn'], test.globs['DBNAME'])
test.globs['conn'].disconnect()
testing.resetCaches()
exceptionformatter.DEBUG_EXCEPTION_FORMATTER = \
test.orig_DEBUG_EXCEPTION_FORMATTER
开发者ID:leorochael,项目名称:mongopersist,代码行数:8,代码来源:test_container.py
示例2: tearDownDebug
def tearDownDebug(test):
sys.stderr = test.real_stderr
sys.argv[:] = test.real_argv
if hasattr(sys, 'ps1'):
del sys.ps1
os.chdir(test.olddir)
# make sure we don't leave environment variables that would cause
# Python to open an interactive console
if 'PYTHONINSPECT' in os.environ:
del os.environ['PYTHONINSPECT']
from zope.security.management import endInteraction
endInteraction()
placelesssetup.tearDown(test)
开发者ID:grodniewicz,项目名称:oship,代码行数:13,代码来源:tests.py
示例3: lockingTearDown
def lockingTearDown(test):
placelesssetup.tearDown(test)
z3c.etree.testing.etreeTearDown(test)
events = test.globs.pop("events")
assert zope.event.subscribers.pop().__self__ is events
del events[:] # being paranoid
del test.globs["Demo"]
del test.globs["DemoFolder"]
gsm = zope.component.getGlobalSiteManager()
gsm.unregisterAdapter(DemoKeyReference,
(IDemo,),
zope.app.keyreference.interfaces.IKeyReference)
gsm.unregisterAdapter(PhysicallyLocatable, (Demo,))
gsm.unregisterAdapter(PhysicallyLocatable, (DemoFolder,))
gsm.unregisterAdapter(DemoKeyReference, (IDemoFolder,),
zope.app.keyreference.interfaces.IKeyReference)
gsm.unregisterAdapter(SiteManagerAdapter,
(zope.interface.Interface,), IComponentLookup)
gsm.unregisterAdapter(DemoAbsoluteURL,
(IDemo, zope.interface.Interface),
zope.traversing.browser.interfaces.IAbsoluteURL)
gsm.unregisterAdapter(DemoAbsoluteURL,
(IDemoFolder, zope.interface.Interface),
zope.traversing.browser.interfaces.IAbsoluteURL)
gsm.unregisterAdapter(z3c.dav.widgets.ListDAVWidget,
(zope.schema.interfaces.IList,
z3c.dav.interfaces.IWebDAVRequest))
gsm.unregisterAdapter(z3c.dav.widgets.ObjectDAVWidget,
(zope.schema.interfaces.IObject,
z3c.dav.interfaces.IWebDAVRequest))
gsm.unregisterAdapter(z3c.dav.widgets.TextDAVWidget,
(zope.schema.interfaces.IText,
z3c.dav.interfaces.IWebDAVRequest))
gsm.unregisterAdapter(z3c.dav.properties.OpaqueWidget,
(z3c.dav.properties.DeadField,
z3c.dav.interfaces.IWebDAVRequest))
gsm.unregisterAdapter(z3c.dav.widgets.TextDAVWidget,
(zope.schema.interfaces.IURI,
z3c.dav.interfaces.IWebDAVRequest))
endInteraction()
transaction.abort()
test.globs["conn"].close()
test.globs["db"].close()
开发者ID:mkerrin,项目名称:z3c.davapp.zopelocking,代码行数:50,代码来源:tests.py
示例4: tearDown
def tearDown(test):
placelesssetup.tearDown(test)
module.tearDown(test)
try:
del Person._p_mongo_store_type
except AttributeError:
pass
try:
del SimplePerson._p_mongo_store_type
except AttributeError:
pass
testing.cleanDB(test.globs['conn'], test.globs['DBNAME'])
test.globs['conn'].disconnect()
testing.resetCaches()
exceptionformatter.DEBUG_EXCEPTION_FORMATTER = \
test.orig_DEBUG_EXCEPTION_FORMATTER
开发者ID:kedder,项目名称:mongopersist,代码行数:16,代码来源:test_container.py
示例5: test_suite
def test_suite():
setUp()
import zope.app.component
XMLConfig('meta.zcml', zope.app.component)()
#import Products.Five
#XMLConfig('meta.zcml', Products.Five)()
import cornerstone.browser
XMLConfig('base.zcml', cornerstone.browser)()
return unittest.TestSuite([
doctest.DocFileSuite(
file,
package="cornerstone.browser",
optionflags=optionflags,
globs=dict(interact=interlude.interact, pprint=pprint),
) for file in TESTFILES
])
tearDown()
开发者ID:bluedynamics,项目名称:cornerstone.browser,代码行数:18,代码来源:test_base.py
示例6: wrapper
def wrapper(*args, **kw):
__doc__ = '''%s ::
@param required_zcml callback or iterable of callbacks
required for setup of configuration needed by fixture
creation.
''' % orig_func.__doc__
# Setup the placeless stuff that's needed to create a fixture
setUp()
# Call any necessary callbacks for setting up ZCML
callZCML(required_zcml)
if kw.has_key('required_zcml'):
zcml = kw.pop('required_zcml')
callZCML(zcml)
value = orig_func(*args, **kw)
# And tear it down
tearDown()
return value
开发者ID:wpjunior,项目名称:proled,代码行数:22,代码来源:placeless.py
示例7: test_suite
def test_suite():
from plone.app.relations import local_role
pas = DocTestSuite(local_role, setUp=placelesssetup.setUp(),
tearDown=placelesssetup.tearDown())
readme = ztc.FunctionalDocFileSuite('README.txt',
package='plone.app.relations')
workflow = ztc.ZopeDocTestSuite('plone.app.relations.workflow',
test_class=ptc.FunctionalTestCase,)
userrelations = ztc.ZopeDocFileSuite('userrelations.txt',
package='plone.app.relations',
test_class=ptc.FunctionalTestCase,)
return unittest.TestSuite([workflow, readme, pas, userrelations])
开发者ID:plone,项目名称:plone.app.relations,代码行数:17,代码来源:tests.py
示例8: configurationTearDown
def configurationTearDown(test):
tearDown()
开发者ID:IMIO,项目名称:affinitic.caching,代码行数:2,代码来源:test_doctest.py
示例9: tearDown
def tearDown(self):
placelesssetup.tearDown()
from tn.plonestyledpage import styled_page
styled_page.getUniqueId = self.old_getUniqueId
styled_page.getEscapedStyleBlock = self.old_getEscapedStyleBlock
开发者ID:tecnologiaenegocios,项目名称:tn.plonebehavior.template,代码行数:5,代码来源:test_compilation_strategy.py
示例10: tearDown
def tearDown(test):
print "\n---------- TEARDOWN ----------", test
placelesssetup.tearDown()
metadata.drop_all(checkfirst=True)
开发者ID:gelie,项目名称:bungeni_src,代码行数:4,代码来源:test_doctests.py
示例11: tearDown
def tearDown(self):
placelesssetup.tearDown()
getToolByName.func_code = self.original_getToolByName_code
开发者ID:tecnologiaenegocios,项目名称:tn.plonemailing,代码行数:3,代码来源:test_behaviors.py
示例12: tearDown
def tearDown(test):
placelesssetup.tearDown()
开发者ID:Zojax,项目名称:zojax.cacheheaders,代码行数:2,代码来源:tests.py
示例13: tearDown
def tearDown(test):
placelesssetup.tearDown()
setup.tearDownTestAsModule(test)
开发者ID:wpjunior,项目名称:proled,代码行数:3,代码来源:tests.py
示例14: tearDown
def tearDown(self):
placelesssetup.tearDown()
开发者ID:tecnologiaenegocios,项目名称:tn.plonemailing,代码行数:2,代码来源:test_subscriber_list.py
示例15: tearDown
def tearDown(self):
placelesssetup.tearDown()
setSite(None)
cache_manager._items = {}
开发者ID:tecnologiaenegocios,项目名称:tn.plonehtmlimagecache,代码行数:4,代码来源:test_html_image_cacher.py
示例16: tearDown
def tearDown(test):
placelesssetup.tearDown()
global old_context
zope.app.appsetup.appsetup.__config_context = old_context
开发者ID:wpjunior,项目名称:proled,代码行数:4,代码来源:tests.py
示例17: tearDown
def tearDown(test):
zope.app.component.hooks.resetHooks()
zope.app.component.hooks.setSite()
transaction.abort()
test.globs['db'].close()
placelesssetup.tearDown()
开发者ID:jean,项目名称:zc.relationship,代码行数:6,代码来源:tests.py
示例18: beforeTearDown
def beforeTearDown(self):
tearDown()
开发者ID:goschtl,项目名称:zope,代码行数:2,代码来源:test_utility.py
示例19: tearDown
def tearDown(self):
tearDown()
开发者ID:jayvdb,项目名称:bibliograph.parsing,代码行数:2,代码来源:test_ris_parser.py
示例20: tearDown
def tearDown(test):
placelesssetup.tearDown()
metadata.drop_all(checkfirst=True)
开发者ID:BenoitTalbot,项目名称:bungeni-portal,代码行数:3,代码来源:tests.py
注:本文中的zope.app.testing.placelesssetup.tearDown函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论