本文整理匯總了Python中pyramid.testing.setUp方法的典型用法代碼示例。如果您正苦於以下問題:Python testing.setUp方法的具體用法?Python testing.setUp怎麽用?Python testing.setUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyramid.testing
的用法示例。
在下文中一共展示了testing.setUp方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp
# 需要導入模塊: from pyramid import testing [as 別名]
# 或者: from pyramid.testing import setUp [as 別名]
def setUp(self) -> None:
"""unittest.TestCase setUp for each test method.
Setup a minimal pyramid configuration.
"""
self.config = setUp()
self.config.include("pyramid_openapi3")
with tempfile.NamedTemporaryFile() as document:
document.write(self.openapi_spec)
document.seek(0)
self.config.pyramid_openapi3_spec(
document.name, route="/foo.yaml", route_name="foo_api_spec"
)
示例2: tearDown
# 需要導入模塊: from pyramid import testing [as 別名]
# 或者: from pyramid.testing import setUp [as 別名]
def tearDown(self) -> None:
"""unittest.TestCase tearDown for each test method.
Tear down everything set up in setUp.
"""
tearDown()
self.config = None
示例3: setUp
# 需要導入模塊: from pyramid import testing [as 別名]
# 或者: from pyramid.testing import setUp [as 別名]
def setUp(self):
self.config = testing.setUp()