Skip to content

Commit

Permalink
Fixed some Flask tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Nov 20, 2024
1 parent ee257a0 commit 5d3a044
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/integrations/flask/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ def index():
client = app.test_client()
response = client.post("/", data=data)
assert response.status_code == 200
response.close()

event, transaction_event = events

Expand Down Expand Up @@ -746,6 +747,7 @@ def hi_tx():
with app.test_client() as client:
response = client.get("/message_tx")
assert response.status_code == 200
response.close()

message_event, transaction_event = events

Expand Down Expand Up @@ -938,7 +940,8 @@ def test_response_status_code_not_found_in_transaction_context(
envelopes = capture_envelopes()

client = app.test_client()
client.get("/not-existing-route")
response = client.get("/not-existing-route")
response.close()

sentry_sdk.get_client().flush()

Expand Down Expand Up @@ -983,14 +986,18 @@ def test_transaction_http_method_default(
events = capture_events()

client = app.test_client()

response = client.get("/nomessage")
assert response.status_code == 200
response.close()

response = client.options("/nomessage")
assert response.status_code == 200
response.close()

response = client.head("/nomessage")
assert response.status_code == 200
response.close()

(event,) = events

Expand Down Expand Up @@ -1020,14 +1027,18 @@ def test_transaction_http_method_custom(
events = capture_events()

client = app.test_client()

response = client.get("/nomessage")
assert response.status_code == 200
response.close()

response = client.options("/nomessage")
assert response.status_code == 200
response.close()

response = client.head("/nomessage")
assert response.status_code == 200
response.close()

assert len(events) == 2

Expand Down

0 comments on commit 5d3a044

Please sign in to comment.