Skip to content

fix(tests): Fix trytond tests #3031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/integrations/trytond/test_trytond.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
from trytond.wsgi import app as trytond_app

from werkzeug.test import Client

from sentry_sdk.integrations.trytond import TrytondWSGIIntegration
from tests.conftest import unpack_werkzeug_response


@pytest.fixture(scope="function")
Expand Down Expand Up @@ -118,8 +120,8 @@ def _(app, request, e):
"/rpcerror", content_type="application/json", data=json.dumps(_data)
)

(content, status, headers) = response
data = json.loads(next(content))
(content, status, headers) = unpack_werkzeug_response(response)
data = json.loads(content)
assert status == "200 OK"
assert headers.get("Content-Type") == "application/json"
assert data == dict(id=42, error=["UserError", ["Sentry error.", "foo", None]])
6 changes: 2 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,14 @@ deps =
tornado-latest: tornado

# Trytond
trytond: werkzeug
trytond-v4: werkzeug<1.0
trytond-v4: trytond~=4.0
trytond-v5: trytond~=5.0
trytond-v6: trytond~=6.0
trytond-v7: trytond~=7.0
trytond-latest: trytond

trytond-v{4}: werkzeug<1.0
trytond-v{5,6,7}: werkzeug<2.0
trytond-latest: werkzeug<2.0

setenv =
PYTHONDONTWRITEBYTECODE=1
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
Expand Down