本文整理汇总了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()