Browse Source

ref(tests): remove sentry.compat (#29626)

josh 3 years ago
parent
commit
b906f4b2dc

+ 1 - 2
tests/sentry/api/endpoints/test_organization_config_repositories.py

@@ -1,7 +1,6 @@
 from django.urls import reverse
 
 from sentry.testutils import APITestCase
-from sentry.utils.compat import filter
 
 
 class OrganizationConfigRepositoriesTest(APITestCase):
@@ -14,6 +13,6 @@ class OrganizationConfigRepositoriesTest(APITestCase):
         response = self.client.get(url, format="json")
 
         assert response.status_code == 200, response.content
-        provider = filter(lambda x: x["id"] == "dummy", response.data["providers"])[0]
+        provider = list(filter(lambda x: x["id"] == "dummy", response.data["providers"]))[0]
         assert provider["name"] == "Example"
         assert provider["config"]

+ 0 - 1
tests/sentry/api/endpoints/test_organization_dashboard_details.py

@@ -8,7 +8,6 @@ from sentry.models import (
     DashboardWidgetQuery,
 )
 from sentry.testutils import OrganizationDashboardWidgetTestCase
-from sentry.utils.compat import zip
 
 
 class OrganizationDashboardDetailsTestCase(OrganizationDashboardWidgetTestCase):

+ 0 - 1
tests/sentry/api/endpoints/test_organization_dashboards.py

@@ -8,7 +8,6 @@ from sentry.models import (
 )
 from sentry.testutils import OrganizationDashboardWidgetTestCase
 from sentry.testutils.helpers.datetime import before_now
-from sentry.utils.compat import zip
 
 
 class OrganizationDashboardsTest(OrganizationDashboardWidgetTestCase):

+ 3 - 4
tests/sentry/api/endpoints/test_organization_member_details.py

@@ -15,7 +15,6 @@ from sentry.models import (
     UserOption,
 )
 from sentry.testutils import APITestCase
-from sentry.utils.compat import map
 
 
 class OrganizationMemberTestBase(APITestCase):
@@ -262,13 +261,13 @@ class UpdateOrganizationMemberTest(OrganizationMemberTestBase):
         self.get_success_response(self.organization.slug, member_om.id, teams=[foo.slug, bar.slug])
 
         member_teams = OrganizationMemberTeam.objects.filter(organizationmember=member_om)
-        team_ids = map(lambda x: x.team_id, member_teams)
+        team_ids = list(map(lambda x: x.team_id, member_teams))
         assert foo.id in team_ids
         assert bar.id in team_ids
 
         member_om = OrganizationMember.objects.get(id=member_om.id)
 
-        teams = map(lambda team: team.slug, member_om.teams.all())
+        teams = list(map(lambda team: team.slug, member_om.teams.all()))
         assert foo.slug in teams
         assert bar.slug in teams
 
@@ -283,7 +282,7 @@ class UpdateOrganizationMemberTest(OrganizationMemberTestBase):
         )
 
         member_om = OrganizationMember.objects.get(id=member_om.id)
-        teams = map(lambda team: team.slug, member_om.teams.all())
+        teams = list(map(lambda team: team.slug, member_om.teams.all()))
         assert len(teams) == 0
 
     def test_can_update_role(self):

+ 1 - 2
tests/sentry/api/endpoints/test_organization_plugins_configs.py

@@ -2,7 +2,6 @@ from django.urls import reverse
 
 from sentry.plugins.base import plugins
 from sentry.testutils import APITestCase
-from sentry.utils.compat import map
 
 
 class OrganizationPluginsTest(APITestCase):
@@ -143,7 +142,7 @@ class OrganizationPluginsTest(APITestCase):
         plugins.get("trello").set_option("key", "some_value", another)
         url = self.url + "?plugins=trello"
         response = self.client.get(url)
-        assert map(lambda x: x["projectSlug"], response.data[0]["projectList"]) == [
+        assert list(map(lambda x: x["projectSlug"], response.data[0]["projectList"])) == [
             "another",
             "proj_a",
             "proj_b",

+ 0 - 1
tests/sentry/api/endpoints/test_project_issues_resolved_in_release.py

@@ -2,7 +2,6 @@ from uuid import uuid1
 
 from sentry.models import Commit, GroupLink, GroupResolution, ReleaseCommit, Repository
 from sentry.testutils import APITestCase
-from sentry.utils.compat import map
 
 
 class ProjectIssuesResolvedInReleaseEndpointTest(APITestCase):

+ 2 - 3
tests/sentry/api/endpoints/test_project_plugins.py

@@ -4,7 +4,6 @@ from django.urls import reverse
 
 from sentry.plugins.base import plugins
 from sentry.testutils import APITestCase
-from sentry.utils.compat import filter
 
 
 class ProjectPluginsTest(APITestCase):
@@ -27,13 +26,13 @@ class ProjectPluginsTest(APITestCase):
         assert response.status_code == 200, (response.status_code, response.content)
         assert len(response.data) >= 9
 
-        auto_tag = filter(lambda p: p["slug"] == "browsers", response.data)[0]
+        auto_tag = next(filter(lambda p: p["slug"] == "browsers", response.data))
         assert auto_tag["name"] == "Auto Tag: Browsers"
         assert auto_tag["enabled"] is True
         assert auto_tag["isHidden"] is False
         self.assert_plugin_shape(auto_tag)
 
-        issues = filter(lambda p: p["slug"] == "issuetrackingplugin2", response.data)[0]
+        issues = next(filter(lambda p: p["slug"] == "issuetrackingplugin2", response.data))
         assert issues["name"] == "IssueTrackingPlugin2"
         assert issues["enabled"] is False
         assert issues["isHidden"] is True

+ 0 - 1
tests/sentry/api/endpoints/test_project_user_reports.py

@@ -6,7 +6,6 @@ from django.utils import timezone
 from sentry.models import EventUser, GroupStatus, UserReport
 from sentry.testutils import APITestCase, SnubaTestCase
 from sentry.testutils.helpers.datetime import before_now, iso_format
-from sentry.utils.compat import map
 
 
 class ProjectUserReportListTest(APITestCase, SnubaTestCase):

+ 0 - 1
tests/sentry/api/endpoints/test_project_users.py

@@ -2,7 +2,6 @@ from django.urls import reverse
 
 from sentry.models import EventUser
 from sentry.testutils import APITestCase
-from sentry.utils.compat import map
 
 
 class ProjectUsersTest(APITestCase):

+ 0 - 1
tests/sentry/api/endpoints/test_team_projects.py

@@ -2,7 +2,6 @@ from django.urls import reverse
 
 from sentry.models import Project, Rule
 from sentry.testutils import APITestCase
-from sentry.utils.compat import map
 
 
 class TeamProjectIndexTest(APITestCase):

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