mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 13:43:03 +08:00
Fix multiple import errors (#1030)
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user