Fix multiple import errors (#1030)

This commit is contained in:
Srikanth Chekuri
2022-04-05 22:01:19 +05:30
committed by GitHub
parent d1f3d51885
commit 36ba621226
3 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ asyncpg>=0.12.0
boto~=2.0
botocore~=1.0
celery>=4.0
flask~=1.0
flask~=2.0
falcon~=2.0
grpcio~=1.27
mysql-connector-python~=8.0

View File

@ -12,9 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from flask import Response
import flask
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse
from werkzeug.wrappers import Response
class InstrumentationTest:
@ -26,7 +26,7 @@ class InstrumentationTest:
@staticmethod
def _custom_response_headers():
resp = Response("test response")
resp = flask.Response("test response")
resp.headers["content-type"] = "text/plain; charset=utf-8"
resp.headers["content-length"] = "13"
resp.headers[
@ -51,4 +51,4 @@ class InstrumentationTest:
)
# pylint: disable=attribute-defined-outside-init
self.client = Client(self.app, BaseResponse)
self.client = Client(self.app, Response)

View File

@ -14,7 +14,7 @@
import flask
from werkzeug.test import Client
from werkzeug.wrappers import BaseResponse
from werkzeug.wrappers import Response
from opentelemetry.instrumentation.flask import FlaskInstrumentor
from opentelemetry.test.test_base import TestBase
@ -52,7 +52,7 @@ class TestAutomatic(InstrumentationTest, TestBase, WsgiTestBase):
self.app.route("/hello/<int:helloid>")(self._hello_endpoint)
# pylint: disable=attribute-defined-outside-init
self.client = Client(self.app, BaseResponse)
self.client = Client(self.app, Response)
resp = self.client.get("/hello/123")
self.assertEqual(200, resp.status_code)
@ -66,7 +66,7 @@ class TestAutomatic(InstrumentationTest, TestBase, WsgiTestBase):
self.app = flask.Flask(__name__)
self.app.route("/hello/<int:helloid>")(self._hello_endpoint)
client = Client(self.app, BaseResponse)
client = Client(self.app, Response)
resp = client.get("/hello/123")
self.assertEqual(200, resp.status_code)