本文整理汇总了Python中morepath.disable_implicit函数的典型用法代码示例。如果您正苦于以下问题:Python disable_implicit函数的具体用法?Python disable_implicit怎么用?Python disable_implicit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了disable_implicit函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_implicit_disabled
def test_implicit_disabled():
morepath.disable_implicit()
config = morepath.setup()
class app(morepath.App):
testing_config = config
@app.path(path='')
class Model(object):
def __init__(self):
pass
@reg.dispatch()
def one():
return "default one"
@app.view(model=Model)
def default(self, request):
try:
return one()
except reg.NoImplicitLookupError:
return "No implicit found"
config.commit()
c = Client(app())
response = c.get('/')
assert response.body == b'No implicit found'
示例2: setup_module
def setup_module(module):
morepath.disable_implicit()
示例3: setup_module
def setup_module(module):
with pytest.deprecated_call():
morepath.disable_implicit()