{ "info": { "author": "", "author_email": "markus@unterwaditzer.net", "bugtrack_url": null, "classifiers": [], "description": "=============\npytest-sentry\n=============\n\n.. image:: https://travis-ci.com/untitaker/pytest-sentry.svg?branch=master\n :target: https://travis-ci.com/untitaker/pytest-sentry\n\n``pytest-sentry`` is a `pytest `_ plugin that sends error\nreports for flaky but ultimately not completely broken tests to `Sentry\n`_.\n\nWhat and Why\n============\n\nLet's say you have a testsuite with some flaky tests that randomly break your\nCI build due to network issues, race conditions or other stuff that you don't\nwant to fix immediately. The known workaround is to retry those tests\nautomatically, for example using `pytest-rerunfailures\n`_.\n\nOne concern against plugins like this is that they just hide the bugs in your\ntestsuite or even other code. After all your CI build is green and your code\nprobably works most of the time.\n\npytest-sentry tries to make that choice a bit easier by tracking flaky test\nfailures in a place separate from your build status. Sentry is already a\ngood choice for keeping tabs on all kinds of errors, important or not, in\nproduction, so let's try to use it in testsuites too.\n\nHow\n===\n\nThe prerequisite is that you already make use of ``pytest`` and\n``pytest-rerunfailures`` in CI. Now install ``pytest-sentry`` and set the\n``PYTEST_SENTRY_DSN`` environment variable to the DSN of a new Sentry project.\n\nNow every test failure that is \"fixed\" by retrying the test is reported to\nSentry, but still does not break CI. Tests that consistently fail will not be\nreported.\n\nAdvanced Options\n================\n\n``pytest-sentry`` supports marking your tests to use a different DSN, client or\nhub per-test. You can use this to provide custom options to the ``Client``\nobject from the `Sentry SDK for Python\n`_::\n\n import random\n import pytest\n\n from sentry_sdk import Hub\n from pytest_sentry import Client\n\n @pytest.mark.sentry_client(None)\n def test_no_sentry():\n # Even though flaky, this test never gets reported to sentry\n assert random.random() > 0.5\n\n @pytest.mark.sentry_client(\"MY NEW DSN\")\n def test_custom_dsn():\n # Use a different DSN to report errors for this one\n assert random.random() > 0.5\n\n # Other invocations:\n\n @pytest.mark.sentry_client(Client(\"CUSTOM DSN\"))\n @pytest.mark.sentry_client(lambda: Client(\"CUSTOM DSN\"))\n @pytest.mark.sentry_client(Hub(Client(\"CUSTOM DSN\")))\n\n\nThe ``Client`` class exposed by ``pytest-sentry`` only has different default\nintegrations. It disables some of the error-capturing integrations to avoid\nsending random expected errors into your project.\n\nLicense\n=======\n\nLicensed under MIT, see ``LICENSE``.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/untitaker/pytest-sentry", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-sentry", "package_url": "https://pypi.org/project/pytest-sentry/", "platform": "", "project_url": "https://pypi.org/project/pytest-sentry/", "project_urls": { "Homepage": "https://github.com/untitaker/pytest-sentry" }, "release_url": "https://pypi.org/project/pytest-sentry/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "A pytest plugin to report flaky tests to Sentry.io", "version": "0.1.0" }, "last_serial": 5092877, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "3a096cecfc250015cab52fced7309a88", "sha256": "f822a4aa5b05088133f651a1a48993d2418f374981e82a6f091474d406c8021d" }, "downloads": -1, "filename": "pytest_sentry-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "3a096cecfc250015cab52fced7309a88", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4844, "upload_time": "2019-04-03T20:43:03", "url": "https://files.pythonhosted.org/packages/07/e6/5d6f5cf242c49f96a6de233108c581ef798caf97116934e2f31d76ee33dd/pytest_sentry-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2761e00b9f3538d0a5b7b8afc4c4af5", "sha256": "c772f8852cb2171cc3f41a795cf296a4be4cc4cb9ecf26717f469d325c44bb34" }, "downloads": -1, "filename": "pytest-sentry-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d2761e00b9f3538d0a5b7b8afc4c4af5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3602, "upload_time": "2019-04-03T20:43:01", "url": "https://files.pythonhosted.org/packages/4e/dd/8876b4961bbccfd2f039d9a638ffaa7449e9d96c8b54204c90855ba73513/pytest-sentry-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3a096cecfc250015cab52fced7309a88", "sha256": "f822a4aa5b05088133f651a1a48993d2418f374981e82a6f091474d406c8021d" }, "downloads": -1, "filename": "pytest_sentry-0.1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "3a096cecfc250015cab52fced7309a88", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 4844, "upload_time": "2019-04-03T20:43:03", "url": "https://files.pythonhosted.org/packages/07/e6/5d6f5cf242c49f96a6de233108c581ef798caf97116934e2f31d76ee33dd/pytest_sentry-0.1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d2761e00b9f3538d0a5b7b8afc4c4af5", "sha256": "c772f8852cb2171cc3f41a795cf296a4be4cc4cb9ecf26717f469d325c44bb34" }, "downloads": -1, "filename": "pytest-sentry-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d2761e00b9f3538d0a5b7b8afc4c4af5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3602, "upload_time": "2019-04-03T20:43:01", "url": "https://files.pythonhosted.org/packages/4e/dd/8876b4961bbccfd2f039d9a638ffaa7449e9d96c8b54204c90855ba73513/pytest-sentry-0.1.0.tar.gz" } ] }