@@ -303,7 +303,7 @@ def unit(session, test_type):
303303
304304@nox .session (python = UNIT_TEST_PYTHON_VERSIONS [- 1 ])
305305@nox .parametrize ("test_type" , ["unit" , "compliance" ])
306- def unit_prerelease (session , test_type ):
306+ def prerelease_deps (session , test_type ):
307307 """Run the unit test suite with prerelease dependencies."""
308308 prerelease (session , os .path .join ("tests" , test_type ))
309309
@@ -483,99 +483,6 @@ def docfx(session):
483483 )
484484
485485
486- @nox .session (python = DEFAULT_PYTHON_VERSION )
487- def prerelease_deps (session ):
488- """Run all tests with prerelease versions of dependencies installed."""
489-
490- # Install all dependencies
491- session .install ("-e" , ".[all, tests, tracing]" )
492- unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
493- session .install (* unit_deps_all )
494- system_deps_all = (
495- SYSTEM_TEST_STANDARD_DEPENDENCIES + SYSTEM_TEST_EXTERNAL_DEPENDENCIES
496- )
497- session .install (* system_deps_all )
498-
499- # Because we test minimum dependency versions on the minimum Python
500- # version, the first version we test with in the unit tests sessions has a
501- # constraints file containing all dependencies and extras.
502- with open (
503- CURRENT_DIRECTORY
504- / "testing"
505- / f"constraints-{ UNIT_TEST_PYTHON_VERSIONS [0 ]} .txt" ,
506- encoding = "utf-8" ,
507- ) as constraints_file :
508- constraints_text = constraints_file .read ()
509-
510- # Ignore leading whitespace and comment lines.
511- constraints_deps = [
512- match .group (1 )
513- for match in re .finditer (
514- r"^\s*(\S+)(?===\S+)" , constraints_text , flags = re .MULTILINE
515- )
516- ]
517-
518- session .install (* constraints_deps )
519-
520- prerel_deps = [
521- "protobuf" ,
522- # dependency of grpc
523- "six" ,
524- "googleapis-common-protos" ,
525- # Exclude version 1.52.0rc1 which has a known issue. See https://github.com/grpc/grpc/issues/32163
526- "grpcio!=1.52.0rc1" ,
527- "grpcio-status" ,
528- "google-api-core" ,
529- "google-auth" ,
530- "proto-plus" ,
531- "google-cloud-testutils" ,
532- # dependencies of google-cloud-testutils"
533- "click" ,
534- ]
535-
536- for dep in prerel_deps :
537- session .install ("--pre" , "--no-deps" , "--upgrade" , dep )
538-
539- # Remaining dependencies
540- other_deps = [
541- "requests" ,
542- ]
543- session .install (* other_deps )
544- session .run ("python" , "-m" , "pip" , "freeze" )
545-
546- # Print out prerelease package versions
547- session .run (
548- "python" , "-c" , "import google.protobuf; print(google.protobuf.__version__)"
549- )
550- session .run ("python" , "-c" , "import grpc; print(grpc.__version__)" )
551- session .run ("python" , "-c" , "import google.auth; print(google.auth.__version__)" )
552-
553- session .run ("py.test" , "tests/unit" )
554-
555- system_test_path = os .path .join ("tests" , "system.py" )
556- system_test_folder_path = os .path .join ("tests" , "system" )
557-
558- # Only run system tests if found.
559- if os .path .exists (system_test_path ):
560- session .run (
561- "py.test" ,
562- "--verbose" ,
563- "-W default::PendingDeprecationWarning" ,
564- f"--junitxml=system_{ session .python } _sponge_log.xml" ,
565- system_test_path ,
566- * session .posargs ,
567- )
568- if os .path .exists (system_test_folder_path ):
569- session .run (
570- "py.test" ,
571- "--verbose" ,
572- "-W default::PendingDeprecationWarning" ,
573- f"--junitxml=system_{ session .python } _sponge_log.xml" ,
574- system_test_folder_path ,
575- * session .posargs ,
576- )
577-
578-
579486@nox .session (python = DEFAULT_PYTHON_VERSION )
580487def core_deps_from_source (session ):
581488 """Run all tests with core dependencies installed from source
0 commit comments