Skip to content

Use sentry_init fixture in tests instead of using Hub directly#759

Merged
untitaker merged 2 commits intogetsentry:masterfrom
alexmojaki:sentry-init-tests
Jul 10, 2020
Merged

Use sentry_init fixture in tests instead of using Hub directly#759
untitaker merged 2 commits intogetsentry:masterfrom
alexmojaki:sentry-init-tests

Conversation

@alexmojaki
Copy link
Copy Markdown
Contributor

@untitaker how's this?

Based on #749 (comment)

Comment thread tests/test_client.py

def test_simple_transport():
def test_simple_transport(sentry_init):
events = []
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need to pass in a transport if you're using sentry_init, just use the capture_events fixture instead which does the same thing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that at first but then decided that wasn't in the spirit of the original test and the name test_simple_transport.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah well you're right

@untitaker untitaker merged commit 0ee6a25 into getsentry:master Jul 10, 2020
@untitaker
Copy link
Copy Markdown
Member

Thanks! Not entirely sure why project coverage is still there. I think I disabled it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants