wrap ContextVar more directly instead of Werkzeug LocalStack
This commit is contained in:
parent
ab36542260
commit
af0feaa116
2 changed files with 59 additions and 30 deletions
|
|
@ -323,12 +323,13 @@ def test_app_cli_has_app_context(app, runner):
|
|||
# the loaded app should be the same as current_app
|
||||
same_app = current_app._get_current_object() is app
|
||||
# only one app context should be pushed
|
||||
stack_size = len(_app_ctx_stack._local.stack)
|
||||
stack = _app_ctx_stack.var.get(None)
|
||||
stack_size = stack is not None and len(stack) == 1
|
||||
return same_app, stack_size, value
|
||||
|
||||
cli = FlaskGroup(create_app=lambda: app)
|
||||
result = runner.invoke(cli, ["check", "x"], standalone_mode=False)
|
||||
assert result.return_value == (True, 1, True)
|
||||
assert result.return_value == (True, True, True)
|
||||
|
||||
|
||||
def test_with_appcontext(runner):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue