Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
add-chalice-tox
  • Loading branch information
Gleekzone committed Sep 8, 2020
commit 660eb8f4e22dafd01fdfe294dffdd7f2acee2aca
2 changes: 0 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ dnspython<2.0
newrelic
executing
asttokens
chalice
pytest_chalice
29 changes: 0 additions & 29 deletions tests/integrations/chalice/test_chalice.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,6 @@ def has_request():
return app


@pytest.fixture
def capture_events(monkeypatch):
def inner():
events = []
test_client = sentry_sdk.Hub.current.client
old_capture_event = test_client.transport.capture_event
old_capture_envelope = test_client.transport.capture_envelope

def append_event(event):
events.append(event)
return old_capture_event(event)

def append_envelope(envelope):
for item in envelope:
if item.headers.get("type") in ("event", "transaction"):
events.append(item.payload.json)
return old_capture_envelope(envelope)

monkeypatch.setattr(
test_client.transport, "capture_event", append_event
)
monkeypatch.setattr(
test_client.transport, "capture_envelope", append_envelope
)
return events

return inner


def test_exception_boom(app, client: RequestHandler) -> None:
response = client.get('/boom')
assert response.status_code == 500
Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ envlist =
py3.7-spark

{py3.5,py3.6,py3.7,py3.8,py3.9}-pure_eval
{py3.6,py3.7,py3.8}-chalice

[testenv]
deps =
Expand Down Expand Up @@ -192,6 +193,8 @@ deps =
py3.8: hypothesis

pure_eval: pure_eval
chalice: chalice>=1.16.0
chalice: pytest-chalice==0.0.5

setenv =
PYTHONDONTWRITEBYTECODE=1
Expand All @@ -217,6 +220,7 @@ setenv =
sqlalchemy: TESTPATH=tests/integrations/sqlalchemy
spark: TESTPATH=tests/integrations/spark
pure_eval: TESTPATH=tests/integrations/pure_eval
chalice: TESTPATH=tests/integrations/chalice

COVERAGE_FILE=.coverage-{envname}
passenv =
Expand Down