Browse Source

chore: Remove imports in testutils barrel file (#53872)

By hollowing this out we can move sentry.utils.pytest under
sentry.testutils.

Part of the feedback for #53501

getsentry build will fail until getsentry/getsentry#11308 is merged.
Mark Story 1 year ago
parent
commit
a3202ae3e8

+ 1 - 1
fixtures/apidocs_test_case.py

@@ -5,7 +5,7 @@ from openapi_core import create_spec
 from openapi_core.contrib.django import DjangoOpenAPIRequest, DjangoOpenAPIResponse
 from openapi_core.validation.response.validators import ResponseValidator
 
-from sentry.testutils import APITestCase
+from sentry.testutils.cases import APITestCase
 from sentry.testutils.helpers.datetime import before_now, iso_format
 from sentry.utils import json
 

+ 1 - 1
fixtures/gitlab.py

@@ -2,7 +2,7 @@ from time import time
 
 from sentry.models import Identity, IdentityProvider, Integration, Repository
 from sentry.silo import SiloMode
-from sentry.testutils import APITestCase
+from sentry.testutils.cases import APITestCase
 from sentry.testutils.silo import assume_test_silo_mode
 
 EXTERNAL_ID = "example.gitlab.com:group-x"

+ 1 - 1
fixtures/vsts.py

@@ -3,7 +3,7 @@ from urllib.parse import parse_qs, urlencode, urlparse
 import responses
 
 from sentry.integrations.vsts import VstsIntegrationProvider
-from sentry.testutils import IntegrationTestCase
+from sentry.testutils.cases import IntegrationTestCase
 
 
 class VstsIntegrationTestCase(IntegrationTestCase):

+ 0 - 4
src/sentry/testutils/__init__.py

@@ -1,4 +0,0 @@
-from .asserts import *  # NOQA
-from .cases import *  # NOQA
-from .relay import *  # NOQA
-from .skips import *  # NOQA

+ 1 - 1
src/sentry/testutils/cases.py

@@ -165,7 +165,7 @@ from ..snuba.metrics import (
     get_date_range,
 )
 from ..snuba.metrics.naming_layer.mri import SessionMRI, TransactionMRI, parse_mri
-from . import assert_status_code
+from .asserts import assert_status_code
 from .factories import Factories
 from .fixtures import Fixtures
 from .helpers import AuthProvider, Feature, TaskRunner, override_options, parse_queries

+ 1 - 1
src/sentry/testutils/helpers/api_gateway.py

@@ -12,7 +12,7 @@ from rest_framework.response import Response
 
 from sentry.api.base import control_silo_endpoint, region_silo_endpoint
 from sentry.api.bases.organization import OrganizationEndpoint
-from sentry.testutils import APITestCase
+from sentry.testutils.cases import APITestCase
 from sentry.testutils.region import override_regions
 from sentry.types.region import Region, RegionCategory, clear_global_regions
 from sentry.utils import json

+ 1 - 1
src/sentry/testutils/performance_issues/store_transaction.py

@@ -5,7 +5,7 @@ from typing import Optional, Sequence
 from django.utils import timezone
 
 from sentry.snuba.dataset import Dataset
-from sentry.testutils import SnubaTestCase
+from sentry.testutils.cases import SnubaTestCase
 
 
 class PerfIssueTransactionTestMixin:

+ 1 - 1
src/sentry/testutils/silo.py

@@ -83,7 +83,7 @@ class SiloModeTestDecorator:
 
     @staticmethod
     def _is_acceptance_test(test_class: type) -> bool:
-        from sentry.testutils import AcceptanceTestCase
+        from sentry.testutils.cases import AcceptanceTestCase
 
         return issubclass(test_class, AcceptanceTestCase)
 

+ 1 - 1
src/sentry/utils/pytest/sentry.py

@@ -371,7 +371,7 @@ def pytest_collection_modifyitems(config, items):
         if os.environ.get("RUN_SNUBA_TESTS_ONLY"):
             import inspect
 
-            from sentry.testutils import SnubaTestCase
+            from sentry.testutils.cases import SnubaTestCase
 
             if inspect.isclass(item.cls) and not issubclass(item.cls, SnubaTestCase):
                 # No need to group if we are deselecting this

+ 1 - 1
tests/sentry/api/test_organization_missing_members.py

@@ -2,7 +2,7 @@ from datetime import timedelta
 
 from django.utils import timezone
 
-from sentry.testutils import APITestCase
+from sentry.testutils.cases import APITestCase
 from sentry.testutils.silo import region_silo_test
 
 

Some files were not shown because too many files changed in this diff