(yaml_file)
| 209 | |
| 210 | |
| 211 | def main(yaml_file): |
| 212 | data = load_yaml(yaml_file) |
| 213 | global_variables = data.get('variables', {}) |
| 214 | tests = data.get('tests', []) |
| 215 | |
| 216 | port = int(os.getenv('PGPORT', 8812)) |
| 217 | for binary in [True, False]: |
| 218 | binary_mode = "binary" if binary else "text" |
| 219 | print(f"\n=== Running tests with {binary_mode} mode ===\n") |
| 220 | for test in tests: |
| 221 | iterations = test.get('iterations', 50) |
| 222 | exclusions = test.get('exclude', []) |
| 223 | if 'psycopg3' in exclusions: |
| 224 | print(f"Skipping test '{test['name']}' because it is excluded for psycopg3.") |
| 225 | continue |
| 226 | for i in range(iterations): |
| 227 | print(f"Running test '{test['name']}' [{binary_mode}] (iteration {i + 1})") |
| 228 | connection = psycopg.connect( |
| 229 | host='localhost', |
| 230 | port=port, |
| 231 | user='admin', |
| 232 | password='quest', |
| 233 | dbname='qdb', |
| 234 | autocommit=True |
| 235 | ) |
| 236 | register_varchar_array_type(connection, binary) |
| 237 | run_test(test, global_variables, connection, binary) |
| 238 | connection.close() |
| 239 | |
| 240 | |
| 241 | if __name__ == '__main__': |
no test coverage detected
searching dependent graphs…