@@ -46,31 +46,6 @@ LOWER_BOUND_REQUIREMENTS_FILE = (
4646)
4747PACKAGE_NAME = "{{ api.naming.warehouse_package_name }}"
4848
49- UNIT_TEST_STANDARD_DEPENDENCIES = [
50- "mock",
51- "asyncmock",
52- "pytest",
53- "pytest-cov",
54- "pytest-asyncio",
55- ]
56- UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
57- UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
58- UNIT_TEST_DEPENDENCIES: List[str] = []
59- UNIT_TEST_EXTRAS: List[str] = []
60- UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
61-
62- SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON
63- SYSTEM_TEST_STANDARD_DEPENDENCIES = [
64- "mock",
65- "pytest",
66- "google-cloud-testutils",
67- ]
68- SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
69- SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
70- SYSTEM_TEST_DEPENDENCIES: List[str] = []
71- SYSTEM_TEST_EXTRAS: List[str] = []
72- SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
73-
7449nox.options.sessions = [
7550 "unit",
7651 "system",
@@ -234,31 +209,11 @@ def lint_setup_py(session):
234209
235210
236211def install_unittest_dependencies(session, *requirements):
237- standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
238- session.install(*standard_deps, *requirements)
239-
240- if UNIT_TEST_EXTERNAL_DEPENDENCIES:
241- warnings.warn(
242- " 'unit_test_external_dependencies' is deprecated. Instead, please "
243- " use 'unit_test_dependencies' or 'unit_test_local_dependencies'." ,
244- DeprecationWarning,
245- )
246- session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *requirements)
247-
248- if UNIT_TEST_LOCAL_DEPENDENCIES:
249- session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *requirements)
250-
251- if UNIT_TEST_EXTRAS_BY_PYTHON:
252- extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
253- elif UNIT_TEST_EXTRAS:
254- extras = UNIT_TEST_EXTRAS
255- else:
256- extras = []
257-
258- if extras:
259- session.install( " -e" , f " .[{','.join(extras)}]" , *requirements)
260- else:
261- session.install( " -e" , " ." , *requirements)
212+ requirements_path = str(
213+ CURRENT_DIRECTORY / " testing" / f " requirements-{session.python}.txt"
214+ )
215+ session.install( " -r" , requirements_path)
216+ session.install( " -e" , " ." , " --no-deps" )
262217
263218
264219@nox.session(python =ALL_PYTHON)
@@ -298,37 +253,6 @@ def unit(session, protobuf_implementation):
298253{# TODO(https: //github.com /googleapis /gapic-generator-python /issues /2201) Add a `unit_rest_async` nox session to run tests with [async_rest] extra installed. #}
299254
300255
301- def install_systemtest_dependencies(session, *requirements):
302- {# Note that grpcio <=1.62.2 works on Python 3.11 but fails on 3.12+ because it requires pkg_resources for its source build. #}
303- if session.python >= "3.12":
304- session.install("--pre", "grpcio>=1.75.1")
305- else:
306- session.install("--pre", "grpcio<=1.62.2")
307-
308- session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *requirements)
309-
310- if SYSTEM_TEST_EXTERNAL_DEPENDENCIES:
311- session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *requirements)
312-
313- if SYSTEM_TEST_LOCAL_DEPENDENCIES:
314- session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *requirements)
315-
316- if SYSTEM_TEST_DEPENDENCIES:
317- session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *requirements)
318-
319- if SYSTEM_TEST_EXTRAS_BY_PYTHON:
320- extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, [])
321- elif SYSTEM_TEST_EXTRAS:
322- extras = SYSTEM_TEST_EXTRAS
323- else:
324- extras = []
325-
326- if extras:
327- session.install("-e", f".[{','.join(extras)}]", *requirements)
328- else:
329- session.install("-e", ".", *requirements)
330-
331-
332256@nox.session(python =SYSTEM_TEST_PYTHON_VERSIONS)
333257def system(session):
334258 " " " Run the system test suite." " "
0 commit comments