chore: Cleanup database sessions (#10427)

Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
John Bodley
2020-07-30 23:07:56 -07:00
committed by GitHub
parent 7ff1757448
commit 7645fc85c3
39 changed files with 488 additions and 637 deletions

View File

@@ -194,7 +194,7 @@ class TestCacheWarmUp(SupersetTestCase):
db.session.commit()
def test_dashboard_tags(self):
tag1 = get_tag("tag1", db.session, TagTypes.custom)
tag1 = get_tag("tag1", TagTypes.custom)
# delete first to make test idempotent
self.reset_tag(tag1)
@@ -204,7 +204,7 @@ class TestCacheWarmUp(SupersetTestCase):
self.assertEqual(result, expected)
# tag dashboard 'births' with `tag1`
tag1 = get_tag("tag1", db.session, TagTypes.custom)
tag1 = get_tag("tag1", TagTypes.custom)
dash = self.get_dash_by_slug("births")
tag1_urls = sorted([f"{URL_PREFIX}{slc.url}" for slc in dash.slices])
tagged_object = TaggedObject(
@@ -216,7 +216,7 @@ class TestCacheWarmUp(SupersetTestCase):
self.assertEqual(sorted(strategy.get_urls()), tag1_urls)
strategy = DashboardTagsStrategy(["tag2"])
tag2 = get_tag("tag2", db.session, TagTypes.custom)
tag2 = get_tag("tag2", TagTypes.custom)
self.reset_tag(tag2)
result = sorted(strategy.get_urls())