Skip to content

Commit aae033c

Browse files
committed
add a small test to check the output when calling get_profiling_information, (not a real test)
1 parent d1dcb98 commit aae033c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/fast/test_profiler.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pytest
2+
import duckdb
3+
4+
class TestProfiler:
5+
def test_profiler_matches_expected_format(self):
6+
con = duckdb.connect()
7+
con.enable_profiling()
8+
con.execute("from range(100_000);")
9+
10+
# Test JSON format
11+
profiling_info_json = con.get_profiling_information(format="json")
12+
assert isinstance(profiling_info_json, str)
13+
print(profiling_info_json)
14+
15+
# Test Text format
16+
profiling_info_text = con.get_profiling_information(format="query_tree_optimizer")
17+
assert isinstance(profiling_info_text, str)
18+
print(profiling_info_text) # Print to visually inspect the text format

0 commit comments

Comments
 (0)