Files
mariadb-connector-python/testing/test/conf_test.py
Georg Richter cdd42743cc Coding style fixes (PEP8)
Fixed various coding style stuff detected by flake8.
Added .pre-commit-config.yaml:
With command pre_commit install a hook for flake8 will be
installed.
2022-08-07 16:47:26 +02:00

31 lines
834 B
Python

#!/usr/bin/env python -O
# -*- coding: utf-8 -*-
import os
def glob():
dm = {
"module": os.environ.get('TEST_MODULE', 'mariadb'),
}
return dm
def conf():
d = {
"user": os.environ.get('TEST_DB_USER', 'root'),
"host": os.environ.get('TEST_DB_HOST', 'localhost'),
"database": os.environ.get('TEST_DB_DATABASE', 'testp'),
"port": int(os.environ.get('TEST_DB_PORT', '3306')),
}
if os.environ.get('TEST_REQUIRE_TLS'):
if os.environ.get('TEST_REQUIRE_TLS') == "1":
d["ssl"] = True
if os.environ.get('TEST_RESET_SESSION'):
reset = int(os.environ.get('TEST_RESET_SESSION', '1'))
d["pool_reset_connection"] = reset
if os.environ.get('TEST_DB_PASSWORD'):
d["password"] = os.environ.get('TEST_DB_PASSWORD')
return d