Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion gapic/templates/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8", "3.9", "3.10", "3.11", "3.12",
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -81,7 +82,8 @@ nox.options.error_on_missing_interpreters = True
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def test__get_api_endpoint():
{% for method in service.methods.values() %}{% with method_name = method.name|snake_case %}
{% for mode in ["", "async"] %}
{% if mode == "async" %}
@pytest.mark.asyncio
async def test_{{ method_name }}_api_version_header_async(transport_name="grpc"):
client = {{ service.async_client_name }}(credentials=async_anonymous_credentials(), transport=transport_name)
{% else %}
Expand All @@ -247,8 +248,8 @@ def test_{{ method_name }}_api_version_header(transport_name):
# Mock the actual call within the gRPC stub, and fake the request.
with mock.patch.object(
type(client.transport.{{ method.transport_safe_name|snake_case }}),
'__call__'
) as call:
'__call__'{% if mode == "async" %},
new_callable=AsyncMock{% endif %}) as call:
{% if mode == "async" %}
await client.{{ method_name }}()
{% else %}
Expand Down
11 changes: 6 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ def showcase(
"""Run the Showcase test suite."""

with showcase_library(session, templates=templates, other_opts=other_opts):
# Exclude pytest-asyncio==1.0.0 while we investigate the recent failure described in
# Use pytest-asyncio<1.0.0 while we investigate the recent failure described in
# https://github.com/googleapis/gapic-generator-python/issues/2399
session.install("pytest", "pytest-asyncio!=1.0.0")
session.install("pytest", "pytest-asyncio<1.0.0")
test_directory = Path("tests", "system")
ignore_file = env.get("IGNORE_FILE")
pytest_command = [
Expand Down Expand Up @@ -424,9 +424,9 @@ def showcase_w_rest_async(
with showcase_library(
session, templates=templates, other_opts=other_opts, rest_async_io_enabled=True
):
# Exclude pytest-asyncio==1.0.0 while we investigate the recent failure described in
# Use pytest-asyncio<1.0.0 while we investigate the recent failure described in
# https://github.com/googleapis/gapic-generator-python/issues/2399
session.install("pytest", "pytest-asyncio!=1.0.0")
session.install("pytest", "pytest-asyncio<1.0.0")
test_directory = Path("tests", "system")
ignore_file = env.get("IGNORE_FILE")
pytest_command = [
Expand Down Expand Up @@ -589,7 +589,8 @@ def showcase_mypy(
"""Perform typecheck analysis on the generated Showcase library."""

session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-setuptools",
"types-protobuf",
"types-requests",
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/asset/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/credentials/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/eventarc/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/logging/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/logging_internal/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/redis/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/goldens/redis_selective/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
"pytest-asyncio"
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
Expand All @@ -88,7 +89,8 @@
def mypy(session):
"""Run the type checker."""
session.install(
"mypy",
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410): Use the latest version of mypy
"mypy<1.16.0",
"types-requests",
"types-protobuf",
)
Expand Down
Loading