{"id":23154,"library":"pytest-sentry","title":"pytest-sentry","description":"A pytest plugin to send test run information to Sentry.io. Currently at version 0.5.1, with irregular releases. Compatible with Sentry SDK >=3.0 (since 0.4.0).","status":"active","version":"0.5.1","language":"python","source_language":"en","source_url":"https://github.com/untitaker/pytest-sentry","tags":["pytest","sentry","plugin","monitoring","testing"],"install":[{"cmd":"pip install pytest-sentry","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Required; versions >=3.0 (pytest-sentry >=0.4.0) or >=2.0 (pytest-sentry 0.3.x) or base SDK (older releases)","package":"sentry-sdk","optional":false}],"imports":[{"note":"Plugin auto-loads as pytest plugin; explicit import only needed for advanced usage.","wrong":"","symbol":"pytest_sentry","correct":"import pytest_sentry"}],"quickstart":{"code":"# conftest.py\nimport pytest_sentry\n\nSENTRY_DSN = os.environ.get('SENTRY_DSN', '')\n@pytest.fixture(autouse=True)\ndef sentry_test_hub():\n    pytest_sentry.hub.init(dsn=SENTRY_DSN)\n    yield\n","lang":"python","description":"Basic setup: set SENTRY_DSN environment variable and the plugin will automatically capture test failures and performance data."},"warnings":[{"fix":"Upgrade sentry-sdk to >=3.0.0: pip install -U sentry-sdk","message":"Version 0.4.0+ requires sentry-sdk >=3.0. Older sentry-sdk versions will break.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Use pytest-sentry 0.1.16 with sentry-sdk <2.0, or upgrade sentry-sdk.","message":"Version 0.3.x requires sentry-sdk >=2.0. sentry-sdk<2.0 will break.","severity":"breaking","affected_versions":"0.3.0 - 0.3.3"},{"fix":"Replace pytest_sentry.hub with sentry_sdk: 'import sentry_sdk; sentry_sdk.init(...)'","message":"The 'hub' object is deprecated in favor of direct Sentry SDK usage. Consider using sentry_sdk directly.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'import sentry_sdk; sentry_sdk.init()' instead of 'pytest_sentry.hub.init()'.","cause":"pytest_sentry.hub was removed in newer versions; use sentry_sdk directly.","error":"ImportError: cannot import name 'hub' from 'pytest_sentry'"},{"fix":"Set environment variable SENTRY_DSN or pass it via pytest ini option: '--sentry-dsn=...'","cause":"SENTRY_DSN environment variable is not set or empty.","error":"Sentry could not send events: You need a DSN to send events (DSN not set)"},{"fix":"Upgrade sentry-sdk to >=2.0.0 (or >=3.0.0 for pytest-sentry >=0.4.0).","cause":"Mismatched sentry-sdk version; sentry-sdk <2.0 does not support certain arguments used by pytest-sentry >=0.3.0.","error":"TypeError: Client.__init__() got an unexpected keyword argument 'integrations'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}