1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ # Helpful notes for local usage:
16+ # unset PYENV_VERSION
17+ # pyenv local 3.14.1 3.13.10 3.12.11 3.11.4 3.10.12 3.9.17
18+ # PIP_INDEX_URL=https://pypi.org/simple nox
19+
1520from __future__ import absolute_import
1621import os
1722import pathlib
@@ -100,6 +105,7 @@ def install_prerelease_dependencies(session, constraints_path):
100105 ]
101106 session .install (* other_deps )
102107
108+
103109def default (session , install_grpc = True , prerelease = False , install_async_rest = False ):
104110 """Default unit test session.
105111
@@ -112,7 +118,6 @@ def default(session, install_grpc=True, prerelease=False, install_async_rest=Fal
112118 unittest .skip ("The pre-release session cannot be run without grpc" )
113119
114120 session .install (
115- "dataclasses" ,
116121 "pytest" ,
117122 "pytest-cov" ,
118123 "pytest-mock" ,
@@ -202,20 +207,28 @@ def default(session, install_grpc=True, prerelease=False, install_async_rest=Fal
202207 session .run (* pytest_args )
203208
204209
205- @nox .session (python = PYTHON_VERSIONS )
206- @nox .parametrize (
207- ["install_grpc" , "install_async_rest" , "python_versions" , "proto4" ],
208- [
209- (True , False , None , False ), # Run unit tests with grpcio installed
210- (False , False , None , False ), # Run unit tests without grpcio installed
211- (True , True , None , False ), # Run unit tests with grpcio and async rest installed
212-
210+ @nox .session (python = PYTHON_VERSIONS )
211+ @nox .parametrize (
212+ ["install_grpc" , "install_async_rest" , "python_versions" , "proto4" ],
213+ [
214+ (True , False , None , False ), # Run unit tests with grpcio installed
215+ (False , False , None , False ), # Run unit tests without grpcio installed
216+ (
217+ True ,
218+ True ,
219+ None ,
220+ False ,
221+ ), # Run unit tests with grpcio and async rest installed
213222 # TODO: Remove once we stop support for protobuf 4.x.
214- (True , False , ["3.9" , "3.10" , "3.11" ], True ), # Run proto4 tests with grpcio/grpcio-gcp installed
215- ],
216- )
223+ (
224+ True ,
225+ False ,
226+ ["3.9" , "3.10" , "3.11" ],
227+ True ,
228+ ), # Run proto4 tests with grpcio/grpcio-gcp installed
229+ ],
230+ )
217231def unit (session , install_grpc , install_async_rest , python_versions = None , proto4 = False ):
218-
219232 """Run the unit test suite."""
220233
221234 # TODO: Remove this code and the corresponding parameters once we stop support for protobuf 4.x.
@@ -227,7 +240,7 @@ def unit(session, install_grpc, install_async_rest, python_versions=None, proto4
227240 if proto4 :
228241 # Pin protobuf to a 4.x version to ensure coverage for the legacy code path.
229242 session .install ("protobuf>=4.25.8,<5.0.0" )
230-
243+
231244 default (
232245 session = session ,
233246 install_grpc = install_grpc ,
@@ -257,7 +270,6 @@ def mypy(session):
257270 "types-setuptools" ,
258271 "types-requests" ,
259272 "types-protobuf" ,
260- "types-dataclasses" ,
261273 )
262274 session .run ("mypy" , "google" , "tests" )
263275
0 commit comments