MCPcopy Index your code
hub / github.com/tobymao/sqlglot / test_dialect_aware_diff

Method test_dialect_aware_diff

tests/test_diff.py:295–308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

293 )
294
295 def test_dialect_aware_diff(self):
296 from sqlglot.generator import logger
297
298 with self.assertLogs(logger) as cm:
299 # We want to assert there are no warnings, but the 'assertLogs' method does not support that.
300 # Therefore, we are adding a dummy warning, and then we will assert it is the only warning.
301 logger.warning("Dummy warning")
302
303 expression = parse_one("SELECT foo FROM bar FOR UPDATE", dialect="oracle")
304 self._validate_delta_only(
305 diff_delta_only(expression, expression.copy(), dialect="oracle"), []
306 )
307
308 self.assertEqual(["WARNING:sqlglot:Dummy warning"], cm.output)
309
310 def test_non_expression_leaf_delta(self):
311 expr_src = parse_one("SELECT a UNION SELECT b")

Callers

nothing calls this directly

Calls 4

_validate_delta_onlyMethod · 0.95
parse_oneFunction · 0.90
diff_delta_onlyFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected