A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
cleanup test for sql (#8235)
Shahmir Varqha7ba0081ef1c3
diff --git a/tests/_sql/test_sql.py b/tests/_sql/test_sql.pyindex 25bc4c2af5..4329ffb444 100644--- a/tests/_sql/test_sql.py+++ b/tests/_sql/test_sql.py@@ -9,6 +9,7 @@ from unittest.mock import MagicMock, patchimport pytestfrom marimo._dependencies.dependencies import DependencyManager+from marimo._output.formatting import Plainfrom marimo._plugins import uifrom marimo._sql.engines.ibis import IbisEnginefrom marimo._sql.engines.sqlalchemy import SQLAlchemyEngine@@ -646,8 +647,6 @@ class TestDisplayConfigBehavior:mock_include_opinionated.return_value = Falseimport polars as pl- from marimo._output.formatting import Plain-# Test queryresult = sql("SELECT 1")assert isinstance(result, pl.DataFrame)@@ -665,20 +664,14 @@ class TestDisplayConfigBehavior:@patch("marimo._sql.sql.replace")def test_sql_rich_output_when_opinionated(self, mock_replace):"""Test that SQL uses table() when include_opinionated returns True."""- import duckdbimport polars as pl- # Create a test table- duckdb.sql(- "CREATE OR REPLACE TABLE test_rich AS SELECT * FROM range(5)"- )-with patch("marimo._output.formatters.df_formatters.include_opinionated",return_value=True,):# Test query- result = sql("SELECT * FROM test_rich")+ result = sql("SELECT 1")assert isinstance(result, pl.DataFrame)# Should call replace with table (not Plain)@@ -687,6 +680,3 @@ class TestDisplayConfigBehavior:# The call should be a table objectassert isinstance(call_args, ui.table)-- # Clean up- duckdb.sql("DROP TABLE test_rich")