Skip to content

Commit 40e1956

Browse files
committed
1 parent 89c3a8a commit 40e1956

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

bindings/prql-python/python/tests/conftest.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

bindings/prql-python/python/tests/test_website_queries.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import re
22

33
import prql_python as prql
4+
import pytest
5+
import yaml
6+
7+
8+
@pytest.fixture()
9+
def example_queries():
10+
website_path = "../../web/website/content/_index.md"
11+
with open(website_path, "r") as f:
12+
website = f.read()
13+
website_yaml = yaml.safe_load(website.replace("---", ""))
14+
showcase_section = website_yaml["showcase_section"]["examples"]
15+
return showcase_section
416

517

618
def normalize(sql: str) -> str:
@@ -18,5 +30,5 @@ def test_all_examples(example_queries):
1830
compiled_normalized = normalize(compiled)
1931
truth_normalized = normalize(query["sql"])
2032
assert (
21-
truth_normalized == compiled_normalized
33+
compiled_normalized == truth_normalized
2234
), f"Failed on Query ID: '{query['id']}'"

0 commit comments

Comments
 (0)