Support
Quality
Security
License
Reuse
kandi has reviewed SoloPi and discovered the below as its top functions. This is intended to give you an instant insight into SoloPi implemented functionality, and help decide if they suit your requirements.
SoloPi 自动化测试工具
快速开始
%ANDROID_SDK%\platform-tools\adb.exe devices
开源许可
Copyright (C) 2015-present, Ant Financial Services Group
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
QUESTION
TypeError: __init__() got an unexpected keyword argument 'as_tuple'
Asked 2022-Mar-29 at 23:24While I am testing my API I recently started to get the error below.
if request is None:
> builder = EnvironBuilder(*args, **kwargs)
E TypeError: __init__() got an unexpected keyword argument 'as_tuple'
/usr/local/lib/python3.7/site-packages/werkzeug/test.py:1081: TypeError
As I read from the documentation in the newer version of Werkzeug
the as_tuple
parameter is removed.
Part of my test code is
from flask.testing import FlaskClient
@pytest.fixture(name='test_client')
def _test_client() -> FlaskClient:
app = create_app()
return app.test_client()
class TestPeerscoutAPI:
def test_should_have_access_for_status_page(self, test_client: FlaskClient):
response = test_client.get('/api/status')
assert _get_ok_json(response) == {"status": "OK"}
Any help would be greatly appreciated.
ANSWER
Answered 2022-Mar-29 at 13:29As of version 2.1.0, werkzeug
has removed the as_tuple
argument to Client
. Since Flask wraps werkzeug and you're using a version that still passes this argument, it will fail. See the exact change on the GitHub PR here.
You can take one of two paths to solve this:
Upgrade flask
Pin your werkzeug version
# in requirements.txt
werkzeug==2.0.3
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit