@@ -68,7 +68,7 @@ class = StreamHandler
6868 )"""
6969
7070
71- BLACK_VERSION = "black==19.10b0 "
71+ BLACK_VERSION = "black==22.3.0 "
7272BLACK_PATHS = ["google" , "test" , "noxfile.py" , "setup.py" , "samples" ]
7373DEFAULT_PYTHON_VERSION = "3.8"
7474
@@ -82,10 +82,15 @@ def lint(session):
8282 """
8383 session .install ("flake8" , BLACK_VERSION )
8484 session .run (
85- "black" , "--check" , * BLACK_PATHS ,
85+ "black" ,
86+ "--check" ,
87+ * BLACK_PATHS ,
8688 )
8789 session .run (
88- "flake8" , "google" , "test" , "--max-line-length=88" ,
90+ "flake8" ,
91+ "google" ,
92+ "test" ,
93+ "--max-line-length=88" ,
8994 )
9095
9196
@@ -101,7 +106,8 @@ def blacken(session):
101106 """
102107 session .install (BLACK_VERSION )
103108 session .run (
104- "black" , * BLACK_PATHS ,
109+ "black" ,
110+ * BLACK_PATHS ,
105111 )
106112
107113
@@ -128,17 +134,23 @@ def compliance_test_13(session):
128134 )
129135
130136 session .install (
131- "pytest" , "pytest-cov" , "pytest-asyncio" ,
137+ "pytest" ,
138+ "pytest-cov" ,
139+ "pytest-asyncio" ,
132140 )
133141
134142 session .install ("mock" )
135143 session .install ("-e" , ".[tracing]" )
144+ session .run ("pip" , "install" , "sqlalchemy>=1.1.13,<=1.3.24" , "--force-reinstall" )
145+ session .run ("pip" , "install" , "pytest==6.2.2" , "--force-reinstall" )
146+ session .run ("pip" , "install" , "opentelemetry-api<=1.10" , "--force-reinstall" )
147+ session .run ("pip" , "install" , "opentelemetry-sdk<=1.10" , "--force-reinstall" )
136148 session .run ("python" , "create_test_database.py" )
137149
138150 session .run (
139151 "py.test" ,
140152 "--cov=google.cloud.sqlalchemy_spanner" ,
141- "--cov=tests " ,
153+ "--cov=test " ,
142154 "--cov-append" ,
143155 "--cov-config=.coveragerc" ,
144156 "--cov-report=" ,
@@ -164,7 +176,9 @@ def compliance_test_14(session):
164176 )
165177
166178 session .install (
167- "pytest" , "pytest-cov" , "pytest-asyncio" ,
179+ "pytest" ,
180+ "pytest-cov" ,
181+ "pytest-asyncio" ,
168182 )
169183
170184 session .install ("mock" )
@@ -176,7 +190,7 @@ def compliance_test_14(session):
176190 session .run (
177191 "py.test" ,
178192 "--cov=google.cloud.sqlalchemy_spanner" ,
179- "--cov=tests " ,
193+ "--cov=test " ,
180194 "--cov-append" ,
181195 "--cov-config=.coveragerc" ,
182196 "--cov-report=" ,
@@ -214,7 +228,8 @@ def migration_test(session):
214228 session .run ("python" , "create_test_database.py" )
215229
216230 project = os .getenv (
217- "GOOGLE_CLOUD_PROJECT" , os .getenv ("PROJECT_ID" , "emulator-test-project" ),
231+ "GOOGLE_CLOUD_PROJECT" ,
232+ os .getenv ("PROJECT_ID" , "emulator-test-project" ),
218233 )
219234 db_url = (
220235 f"spanner+spanner:///projects/{ project } /instances/"
@@ -242,7 +257,9 @@ def migration_test(session):
242257 with open (files [0 ], "r" ) as f :
243258 script_code = f .read ()
244259
245- script_code = script_code .replace ("""def upgrade():\n pass""" , UPGRADE_CODE )
260+ script_code = script_code .replace (
261+ """def upgrade() -> None:\n pass""" , UPGRADE_CODE
262+ )
246263 with open (files [0 ], "w" ) as f :
247264 f .write (script_code )
248265
0 commit comments