diff options
Diffstat (limited to 'tests/test_executor.py')
-rw-r--r-- | tests/test_executor.py | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/test_executor.py b/tests/test_executor.py index 9afa225..c5841d3 100644 --- a/tests/test_executor.py +++ b/tests/test_executor.py @@ -27,10 +27,7 @@ class TestExecutor(unittest.TestCase): ) cls.cache = {} - cls.sqls = [ - (sql, expected) - for _, sql, expected in load_sql_fixture_pairs("optimizer/tpc-h/tpc-h.sql") - ] + cls.sqls = [(sql, expected) for _, sql, expected in load_sql_fixture_pairs("optimizer/tpc-h/tpc-h.sql")] @classmethod def tearDownClass(cls): @@ -50,18 +47,17 @@ class TestExecutor(unittest.TestCase): self.assertEqual(Python().generate(parse_one("'x '''")), r"'x \''") def test_optimized_tpch(self): - for sql, optimized in self.sqls[0:20]: - a = self.cached_execute(sql) - b = self.conn.execute(optimized).fetchdf() - self.rename_anonymous(b, a) - assert_frame_equal(a, b) + for i, (sql, optimized) in enumerate(self.sqls[:20], start=1): + with self.subTest(f"{i}, {sql}"): + a = self.cached_execute(sql) + b = self.conn.execute(optimized).fetchdf() + self.rename_anonymous(b, a) + assert_frame_equal(a, b) def test_execute_tpch(self): def to_csv(expression): if isinstance(expression, exp.Table): - return parse_one( - f"READ_CSV('{DIR}{expression.name}.csv.gz', 'delimiter', '|') AS {expression.name}" - ) + return parse_one(f"READ_CSV('{DIR}{expression.name}.csv.gz', 'delimiter', '|') AS {expression.name}") return expression for sql, _ in self.sqls[0:3]: |