Skip to content

Commit

Permalink
tests: Remove broken bottle tests (#3505)
Browse files Browse the repository at this point in the history
The logger test never actually worked as designed (app.logger was never a thing). The 500 error doesn't really test any Bottle-related functionality.
  • Loading branch information
sentrivana committed Sep 5, 2024
1 parent 0934e04 commit 6814df9
Showing 1 changed file with 0 additions and 48 deletions.
48 changes: 0 additions & 48 deletions tests/integrations/bottle/test_bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,29 +337,6 @@ def index():
assert len(events) == 1


def test_logging(sentry_init, capture_events, app, get_client):
# ensure that Bottle's logger magic doesn't break ours
sentry_init(
integrations=[
bottle_sentry.BottleIntegration(),
LoggingIntegration(event_level="ERROR"),
]
)

@app.route("/")
def index():
app.logger.error("hi")
return "ok"

events = capture_events()

client = get_client()
client.get("/")

(event,) = events
assert event["level"] == "error"


def test_mount(app, capture_exceptions, capture_events, sentry_init, get_client):
sentry_init(integrations=[bottle_sentry.BottleIntegration()])

Expand Down Expand Up @@ -387,31 +364,6 @@ def crashing_app(environ, start_response):
assert event["exception"]["values"][0]["mechanism"]["handled"] is False


def test_500(sentry_init, capture_events, app, get_client):
sentry_init(integrations=[bottle_sentry.BottleIntegration()])

set_debug(False)
app.catchall = True

@app.route("/")
def index():
1 / 0

@app.error(500)
def error_handler(err):
capture_message("error_msg")
return "My error"

events = capture_events()

client = get_client()
response = client.get("/")
assert response[1] == "500 Internal Server Error"

_, event = events
assert event["message"] == "error_msg"


def test_error_in_errorhandler(sentry_init, capture_events, app, get_client):
sentry_init(integrations=[bottle_sentry.BottleIntegration()])

Expand Down

0 comments on commit 6814df9

Please sign in to comment.