37
37
38
38
TEST_CONFIG = {
39
39
# You can opt out from the test for specific Python versions.
40
- "ignored_versions" : ["2.7" ],
40
+ 'ignored_versions' : ["2.7" ],
41
+
41
42
# An envvar key for determining the project id to use. Change it
42
43
# to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
43
44
# build specific Cloud project. You can also use your own string
44
45
# to use your own Cloud project.
45
- " gcloud_project_env" : " GOOGLE_CLOUD_PROJECT" ,
46
+ ' gcloud_project_env' : ' GOOGLE_CLOUD_PROJECT' ,
46
47
# 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
48
+
47
49
# A dictionary you want to inject into your test. Don't put any
48
50
# secrets here. These values will override predefined values.
49
- " envs" : {},
51
+ ' envs' : {},
50
52
}
51
53
52
54
53
55
try :
54
56
# Ensure we can import noxfile_config in the project's directory.
55
- sys .path .append ("." )
57
+ sys .path .append ('.' )
56
58
from noxfile_config import TEST_CONFIG_OVERRIDE
57
59
except ImportError as e :
58
60
print ("No user noxfile_config found: detail: {}" .format (e ))
@@ -67,12 +69,12 @@ def get_pytest_env_vars():
67
69
ret = {}
68
70
69
71
# Override the GCLOUD_PROJECT and the alias.
70
- env_key = TEST_CONFIG [" gcloud_project_env" ]
72
+ env_key = TEST_CONFIG [' gcloud_project_env' ]
71
73
# This should error out if not set.
72
- ret [" GOOGLE_CLOUD_PROJECT" ] = os .environ [env_key ]
74
+ ret [' GOOGLE_CLOUD_PROJECT' ] = os .environ [env_key ]
73
75
74
76
# Apply user supplied envs.
75
- ret .update (TEST_CONFIG [" envs" ])
77
+ ret .update (TEST_CONFIG [' envs' ])
76
78
return ret
77
79
78
80
@@ -81,7 +83,7 @@ def get_pytest_env_vars():
81
83
ALL_VERSIONS = ["2.7" , "3.6" , "3.7" , "3.8" ]
82
84
83
85
# Any default versions that should be ignored.
84
- IGNORED_VERSIONS = TEST_CONFIG [" ignored_versions" ]
86
+ IGNORED_VERSIONS = TEST_CONFIG [' ignored_versions' ]
85
87
86
88
TESTED_VERSIONS = sorted ([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS ])
87
89
@@ -136,7 +138,7 @@ def lint(session):
136
138
args = FLAKE8_COMMON_ARGS + [
137
139
"--application-import-names" ,
138
140
"," .join (local_names ),
139
- "." ,
141
+ "."
140
142
]
141
143
session .run ("flake8" , * args )
142
144
@@ -180,9 +182,9 @@ def py(session):
180
182
if session .python in TESTED_VERSIONS :
181
183
_session_tests (session )
182
184
else :
183
- session .skip (
184
- "SKIPPED: {} tests are disabled for this sample." . format ( session .python )
185
- )
185
+ session .skip ("SKIPPED: {} tests are disabled for this sample." . format (
186
+ session .python
187
+ ))
186
188
187
189
188
190
#
0 commit comments