File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
bindings/prql-python/python/tests Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
import re
2
2
3
3
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
4
16
5
17
6
18
def normalize (sql : str ) -> str :
@@ -18,5 +30,5 @@ def test_all_examples(example_queries):
18
30
compiled_normalized = normalize (compiled )
19
31
truth_normalized = normalize (query ["sql" ])
20
32
assert (
21
- truth_normalized == compiled_normalized
33
+ compiled_normalized == truth_normalized
22
34
), f"Failed on Query ID: '{ query ['id' ]} '"
You can’t perform that action at this time.
0 commit comments