Skip to content

Commit 372c070

Browse files
committed
chore: preserve google-cloud-spanner change
Until #17373 is resolved, we have to keep the google-cloud-spanner manual fix.
1 parent f77a9ba commit 372c070

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

packages/google-cloud-spanner/noxfile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"pytest",
4444
"pytest-cov",
4545
"pytest-asyncio",
46+
"pytest-xdist",
4647
]
4748
MOCK_SERVER_ADDITIONAL_DEPENDENCIES = [
4849
"google-cloud-testutils",
@@ -240,6 +241,8 @@ def unit(session, protobuf_implementation):
240241
# Run py.test against the unit tests.
241242
args = [
242243
"py.test",
244+
"-n",
245+
"auto",
243246
"-s",
244247
f"--junitxml=unit_{session.python}_sponge_log.xml",
245248
"--cov=google",
@@ -754,7 +757,6 @@ def prerelease_deps(session, protobuf_implementation, database_dialect):
754757
def mypy(session):
755758
"""Run the type checker."""
756759
session.skip("Mypy is not yet supported")
757-
758760
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2579):
759761
# use the latest version of mypy
760762
session.install(
@@ -832,12 +834,15 @@ def core_deps_from_source(session, protobuf_implementation):
832834
dep_paths = [str(deps_dir / dep) for dep in core_dependencies_from_source]
833835

834836
session.install(*dep_paths, "--no-deps", "--ignore-installed")
837+
session.install("pytest-xdist")
835838
print(
836839
f"Installed {', '.join(core_dependencies_from_source)} locally from {deps_dir}"
837840
)
838841

839842
session.run(
840843
"py.test",
844+
"-n",
845+
"auto",
841846
"tests/unit",
842847
env={
843848
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,

packages/google-cloud-spanner/setup.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,17 @@
6060
"google-cloud-monitoring >= 2.16.0",
6161
"mmh3 >= 4.1.0",
6262
]
63-
extras = {"libcst": "libcst >= 0.2.5"}
63+
extras = {
64+
"libcst": "libcst >= 0.2.5",
65+
"test": [
66+
"pytest",
67+
"mock",
68+
"asyncmock",
69+
"pytest-cov",
70+
"pytest-asyncio",
71+
"pytest-xdist",
72+
],
73+
}
6474

6575
url = "https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-spanner"
6676

0 commit comments

Comments
 (0)