7
7
8
8
9
9
def 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
+ )
11
13
12
14
13
15
@pytest .fixture (scope = "class" )
@@ -105,7 +107,7 @@ def _profile_ci_sql_server():
105
107
106
108
107
109
def _profile_user ():
108
- return {
110
+ profile = {
109
111
** _all_profiles_base (),
110
112
** {
111
113
"host" : os .getenv ("SQLSERVER_TEST_HOST" ),
@@ -116,19 +118,24 @@ def _profile_user():
116
118
"trust_cert" : bool (os .getenv ("SQLSERVER_TEST_TRUST_CERT" , "False" )),
117
119
},
118
120
}
121
+ return profile
119
122
120
123
121
124
def _profile_user_azure ():
122
- return {
125
+ profile = {
123
126
** _all_profiles_base (),
124
127
** {
125
128
"host" : os .getenv ("SQLSERVER_TEST_HOST" ),
126
- "authentication" : " auto" ,
129
+ "authentication" : os . getenv ( "SQLSERVER_TEST_AUTH" , " auto") ,
127
130
"encrypt" : True ,
128
131
"trust_cert" : True ,
129
132
"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" ),
130
136
},
131
137
}
138
+ return profile
132
139
133
140
134
141
@pytest .fixture (autouse = True )
0 commit comments