@@ -34,6 +34,31 @@ def __exit__(self, exc_type, exc_value, exc_traceback):
34
34
self .connection .close ()
35
35
36
36
37
+ @pytest .mark .skipif (not DB_DEPENDENCIES , reason = "Requires dependencies" )
38
+ class TestSQLLITE :
39
+ def test_manager_can_be_built_without_exception (self , schema_file_path_sqlite ):
40
+
41
+ with NamedTemporaryFile () as f :
42
+ sqllite_url = f"sqlite:///{ f .name } "
43
+ config_dict = {
44
+ "project_name" : "test" ,
45
+ "record_identifier" : "sample1" ,
46
+ "schema_path" : schema_file_path_sqlite ,
47
+ "database" : {"sqlite_url" : f .name },
48
+ }
49
+
50
+ with ContextManagerDBTesting (sqllite_url ):
51
+ try :
52
+ SamplePipestatManager (
53
+ schema_path = schema_file_path_sqlite ,
54
+ record_identifier = "irrelevant" ,
55
+ database_only = True ,
56
+ config_dict = config_dict ,
57
+ )
58
+ except Exception as e :
59
+ pytest .fail (f"Pipestat manager construction failed: { e } )" )
60
+
61
+
37
62
@pytest .mark .skipif (not DB_DEPENDENCIES , reason = "Requires dependencies" )
38
63
@pytest .mark .skipif (SERVICE_UNAVAILABLE , reason = "requires service X to be available" )
39
64
class TestDatabaseOnly :
@@ -134,27 +159,3 @@ def test_select_pagination(
134
159
result = psm .select_records (cursor = offset , limit = limit )
135
160
print (result )
136
161
assert len (result ["records" ]) == min (max ((psm .record_count - offset ), 0 ), limit )
137
-
138
-
139
- class TestSQLLITE :
140
- def test_manager_can_be_built_without_exception (self , schema_file_path_sqlite ):
141
-
142
- with NamedTemporaryFile () as f :
143
- sqllite_url = f"sqlite:///{ f .name } "
144
- config_dict = {
145
- "project_name" : "test" ,
146
- "record_identifier" : "sample1" ,
147
- "schema_path" : "sample_output_schema_sqlite.yaml" ,
148
- "database" : {"sqlite_url" : f .name },
149
- }
150
-
151
- with ContextManagerDBTesting (sqllite_url ):
152
- try :
153
- SamplePipestatManager (
154
- schema_path = schema_file_path_sqlite ,
155
- record_identifier = "irrelevant" ,
156
- database_only = True ,
157
- config_dict = config_dict ,
158
- )
159
- except Exception as e :
160
- pytest .fail (f"Pipestat manager construction failed: { e } )" )
0 commit comments