diff --git a/tests/columns/test_array.py b/tests/columns/test_array.py index 7da4dadfb..4677ef995 100644 --- a/tests/columns/test_array.py +++ b/tests/columns/test_array.py @@ -11,7 +11,7 @@ Timestamptz, ) from piccolo.table import Table -from tests.base import engines_only, engines_skip, sqlite_only +from tests.base import engines_only, sqlite_only class MyTable(Table): @@ -40,6 +40,7 @@ def setUp(self): def tearDown(self): MyTable.alter().drop_table().run_sync() + @engines_only("postgres", "sqlite") def test_storage(self): """ Make sure data can be stored and retrieved. @@ -53,7 +54,7 @@ def test_storage(self): assert row is not None self.assertEqual(row.value, [1, 2, 3]) - @engines_skip("sqlite") + @engines_only("postgres") def test_index(self): """ Indexes should allow individual array elements to be queried. @@ -67,7 +68,7 @@ def test_index(self): MyTable.select(MyTable.value[0]).first().run_sync(), {"value": 1} ) - @engines_skip("sqlite") + @engines_only("postgres") def test_all(self): """ Make sure rows can be retrieved where all items in an array match a @@ -94,7 +95,7 @@ def test_all(self): None, ) - @engines_skip("sqlite") + @engines_only("postgres") def test_any(self): """ Make sure rows can be retrieved where any items in an array match a @@ -121,7 +122,7 @@ def test_any(self): None, ) - @engines_skip("sqlite") + @engines_only("postgres") def test_cat(self): """ Make sure values can be appended to an array. @@ -136,8 +137,7 @@ def test_cat(self): ).run_sync() self.assertEqual( - MyTable.select(MyTable.value).run_sync(), - [{"value": [1, 1, 1, 2]}], + MyTable.select().run_sync(), [{"id": 1, "value": [1, 1, 1, 2]}] ) # Try plus symbol @@ -147,8 +147,7 @@ def test_cat(self): ).run_sync() self.assertEqual( - MyTable.select(MyTable.value).run_sync(), - [{"value": [1, 1, 1, 2, 3]}], + MyTable.select().run_sync(), [{"id": 1, "value": [1, 1, 1, 2, 3]}] ) # Make sure non-list values work @@ -158,8 +157,8 @@ def test_cat(self): ).run_sync() self.assertEqual( - MyTable.select(MyTable.value).run_sync(), - [{"value": [1, 1, 1, 2, 3, 4]}], + MyTable.select().run_sync(), + [{"id": 1, "value": [1, 1, 1, 2, 3, 4]}], ) @sqlite_only