3737
3838TEST_CONFIG = {
3939 # You can opt out from the test for specific Python versions.
40- 'ignored_versions' : ["2.7" ],
41-
40+ "ignored_versions" : ["2.7" ],
4241 # Old samples are opted out of enforcing Python type hints
4342 # All new samples should feature them
44- 'enforce_type_hints' : False ,
45-
43+ "enforce_type_hints" : False ,
4644 # An envvar key for determining the project id to use. Change it
4745 # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
4846 # build specific Cloud project. You can also use your own string
4947 # to use your own Cloud project.
50- ' gcloud_project_env' : ' GOOGLE_CLOUD_PROJECT' ,
48+ " gcloud_project_env" : " GOOGLE_CLOUD_PROJECT" ,
5149 # 'gcloud_project_env': 'BUILD_SPECIFIC_GCLOUD_PROJECT',
52-
5350 # A dictionary you want to inject into your test. Don't put any
5451 # secrets here. These values will override predefined values.
55- ' envs' : {},
52+ " envs" : {},
5653}
5754
5855
5956try :
6057 # Ensure we can import noxfile_config in the project's directory.
61- sys .path .append ('.' )
58+ sys .path .append ("." )
6259 from noxfile_config import TEST_CONFIG_OVERRIDE
6360except ImportError as e :
6461 print ("No user noxfile_config found: detail: {}" .format (e ))
@@ -73,12 +70,12 @@ def get_pytest_env_vars():
7370 ret = {}
7471
7572 # Override the GCLOUD_PROJECT and the alias.
76- env_key = TEST_CONFIG [' gcloud_project_env' ]
73+ env_key = TEST_CONFIG [" gcloud_project_env" ]
7774 # This should error out if not set.
78- ret [' GOOGLE_CLOUD_PROJECT' ] = os .environ [env_key ]
75+ ret [" GOOGLE_CLOUD_PROJECT" ] = os .environ [env_key ]
7976
8077 # Apply user supplied envs.
81- ret .update (TEST_CONFIG [' envs' ])
78+ ret .update (TEST_CONFIG [" envs" ])
8279 return ret
8380
8481
@@ -87,7 +84,7 @@ def get_pytest_env_vars():
8784ALL_VERSIONS = ["2.7" , "3.6" , "3.7" , "3.8" ]
8885
8986# Any default versions that should be ignored.
90- IGNORED_VERSIONS = TEST_CONFIG [' ignored_versions' ]
87+ IGNORED_VERSIONS = TEST_CONFIG [" ignored_versions" ]
9188
9289TESTED_VERSIONS = sorted ([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS ])
9390
@@ -136,7 +133,7 @@ def _determine_local_import_names(start_dir):
136133
137134@nox .session
138135def lint (session ):
139- if not TEST_CONFIG [' enforce_type_hints' ]:
136+ if not TEST_CONFIG [" enforce_type_hints" ]:
140137 session .install ("flake8" , "flake8-import-order" )
141138 else :
142139 session .install ("flake8" , "flake8-import-order" , "flake8-annotations" )
@@ -145,9 +142,11 @@ def lint(session):
145142 args = FLAKE8_COMMON_ARGS + [
146143 "--application-import-names" ,
147144 "," .join (local_names ),
148- "."
145+ "." ,
149146 ]
150147 session .run ("flake8" , * args )
148+
149+
151150#
152151# Black
153152#
@@ -160,6 +159,7 @@ def blacken(session):
160159
161160 session .run ("black" , * python_files )
162161
162+
163163#
164164# Sample Tests
165165#
@@ -199,9 +199,9 @@ def py(session):
199199 if session .python in TESTED_VERSIONS :
200200 _session_tests (session )
201201 else :
202- session .skip ("SKIPPED: {} tests are disabled for this sample." . format (
203- session .python
204- ))
202+ session .skip (
203+ "SKIPPED: {} tests are disabled for this sample." . format ( session .python )
204+ )
205205
206206
207207#
0 commit comments