77
88
99def pytest_addoption (parser ):
10- parser .addoption ("--profile" , action = "store" , default = "user" , type = str )
10+ parser .addoption (
11+ "--profile" , action = "store" , default = os .getenv ("PROFILE_NAME" , "user" ), type = str
12+ )
1113
1214
1315@pytest .fixture (scope = "class" )
@@ -105,7 +107,7 @@ def _profile_ci_sql_server():
105107
106108
107109def _profile_user ():
108- return {
110+ profile = {
109111 ** _all_profiles_base (),
110112 ** {
111113 "host" : os .getenv ("SQLSERVER_TEST_HOST" ),
@@ -116,19 +118,24 @@ def _profile_user():
116118 "trust_cert" : bool (os .getenv ("SQLSERVER_TEST_TRUST_CERT" , "False" )),
117119 },
118120 }
121+ return profile
119122
120123
121124def _profile_user_azure ():
122- return {
125+ profile = {
123126 ** _all_profiles_base (),
124127 ** {
125128 "host" : os .getenv ("SQLSERVER_TEST_HOST" ),
126- "authentication" : " auto" ,
129+ "authentication" : os . getenv ( "SQLSERVER_TEST_AUTH" , " auto") ,
127130 "encrypt" : True ,
128131 "trust_cert" : True ,
129132 "database" : os .getenv ("SQLSERVER_TEST_DBNAME" ),
133+ "client_id" : os .getenv ("SQLSERVER_TEST_CLIENT_ID" ),
134+ "client_secret" : os .getenv ("SQLSERVER_TEST_CLIENT_SECRET" ),
135+ "tenant_id" : os .getenv ("SQLSERVER_TEST_TENANT_ID" ),
130136 },
131137 }
138+ return profile
132139
133140
134141@pytest .fixture (autouse = True )
0 commit comments