def pytest_runtest_teardown(item): if not os.environ.get("USE_SNUBA", False): from sentry import tsdb # TODO(dcramer): this only works if this is the correct tsdb backend tsdb.flush() # XXX(dcramer): only works with DummyNewsletter from sentry import newsletter if hasattr(newsletter.backend, "clear"): newsletter.backend.clear() from sentry.utils.redis import clusters with clusters.get("default").all() as client: client.flushdb() from celery.task.control import discard_all discard_all() from sentry.models import OrganizationOption, ProjectOption, UserOption for model in (OrganizationOption, ProjectOption, UserOption): model.objects.clear_local_cache() Hub.main.bind_client(None)
def pytest_runtest_teardown(item): from sentry import tsdb # TODO(dcramer): this only works if this is the correct tsdb backend tsdb.flush() from sentry.utils.redis import clusters with clusters.get('default').all() as client: client.flushdb() from celery.task.control import discard_all discard_all()
def pytest_runtest_teardown(item): from sentry import tsdb # TODO(dcramer): this only works if this is the correct tsdb backend tsdb.flush() # XXX(dcramer): only works with DummyNewsletter from sentry import newsletter if hasattr(newsletter.backend, 'clear'): newsletter.backend.clear() from sentry.utils.redis import clusters with clusters.get('default').all() as client: client.flushdb() from celery.task.control import discard_all discard_all()
def pytest_runtest_teardown(item): from sentry import tsdb # TODO(dcramer): this only works if this is the correct tsdb backend tsdb.flush() # XXX(dcramer): only works with DummyNewsletter from sentry import newsletter if hasattr(newsletter.backend, 'clear'): newsletter.backend.clear() from sentry.utils.redis import clusters with clusters.get('default').all() as client: client.flushdb() from celery.task.control import discard_all discard_all() from sentry.models import OrganizationOption, ProjectOption, UserOption for model in (OrganizationOption, ProjectOption, UserOption): model.objects.clear_local_cache()
def tsdb_teardown(): from sentry import tsdb # TODO(dcramer): this only works if this is the correct tsdb backend tsdb.flush()