This is an automated email from the ASF dual-hosted git repository.

yjc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new b45f89b954 refactor: consistent migration tests organization (#19635)
b45f89b954 is described below

commit b45f89b9540442fe398831e1f29dfd60a153bab6
Author: Jesse Yang <[email protected]>
AuthorDate: Sat Apr 9 07:50:52 2022 -0700

    refactor: consistent migration tests organization (#19635)
---
 ...migrate_native_filters_to_new_schema__tests.py} |  0
 .../fb13d49b72f9_better_filters__tests.py}         | 27 ++++++++++------------
 ...21_migrate_filter_sets_to_new_format__tests.py} |  0
 3 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/tests/integration_tests/migrations/f1410ed7ec95_tests.py 
b/tests/integration_tests/migrations/f1410ed7ec95_migrate_native_filters_to_new_schema__tests.py
similarity index 100%
rename from tests/integration_tests/migrations/f1410ed7ec95_tests.py
rename to 
tests/integration_tests/migrations/f1410ed7ec95_migrate_native_filters_to_new_schema__tests.py
diff --git a/tests/integration_tests/migration_tests.py 
b/tests/integration_tests/migrations/fb13d49b72f9_better_filters__tests.py
similarity index 63%
rename from tests/integration_tests/migration_tests.py
rename to 
tests/integration_tests/migrations/fb13d49b72f9_better_filters__tests.py
index 444aefbc36..f1fb9d7376 100644
--- a/tests/integration_tests/migration_tests.py
+++ b/tests/integration_tests/migrations/fb13d49b72f9_better_filters__tests.py
@@ -21,20 +21,17 @@ from 
superset.migrations.versions.fb13d49b72f9_better_filters import (
     upgrade_slice,
 )
 
-from .base_tests import SupersetTestCase
 
+def test_upgrade_slice():
+    slc = Slice(
+        slice_name="FOO",
+        viz_type="filter_box",
+        params=json.dumps(dict(metric="foo", groupby=["bar"])),
+    )
+    upgrade_slice(slc)
+    params = json.loads(slc.params)
+    assert "metric" not in params
+    assert "filter_configs" in params
 
-class TestMigration(SupersetTestCase):
-    def test_upgrade_slice(self):
-        slc = Slice(
-            slice_name="FOO",
-            viz_type="filter_box",
-            params=json.dumps(dict(metric="foo", groupby=["bar"])),
-        )
-        upgrade_slice(slc)
-        params = json.loads(slc.params)
-        self.assertNotIn("metric", params)
-        self.assertIn("filter_configs", params)
-
-        cfg = params["filter_configs"][0]
-        self.assertEqual(cfg.get("metric"), "foo")
+    cfg = params["filter_configs"][0]
+    assert cfg.get("metric") == "foo"
diff --git a/tests/integration_tests/migrations/fc3a3a8ff221_tests.py 
b/tests/integration_tests/migrations/fc3a3a8ff221_migrate_filter_sets_to_new_format__tests.py
similarity index 100%
rename from tests/integration_tests/migrations/fc3a3a8ff221_tests.py
rename to 
tests/integration_tests/migrations/fc3a3a8ff221_migrate_filter_sets_to_new_format__tests.py

Reply via email to