Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 5e29869

Browse files
committed
adds pytest-xdist install AND -n=auto argument
1 parent ff2129e commit 5e29869

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

noxfile.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ def snippets(session):
318318
)
319319

320320
# Install all test dependencies, then install local packages in place.
321-
session.install("pytest", "google-cloud-testutils", "-c", constraints_path)
321+
session.install(
322+
"pytest", "pytest-xdist", "google-cloud-testutils", "-c", constraints_path
323+
)
322324
session.install("google-cloud-storage", "-c", constraints_path)
323325
session.install("grpcio", "-c", constraints_path)
324326

@@ -334,9 +336,12 @@ def snippets(session):
334336
# Run py.test against the snippets tests.
335337
# Skip tests in samples/snippets, as those are run in a different session
336338
# using the nox config from that directory.
337-
session.run("py.test", os.path.join("docs", "snippets.py"), *session.posargs)
339+
session.run(
340+
"py.test", "-n=auto", os.path.join("docs", "snippets.py"), *session.posargs
341+
)
338342
session.run(
339343
"py.test",
344+
"-n=auto",
340345
"samples",
341346
"-W default::PendingDeprecationWarning",
342347
"--ignore=samples/desktopapp",
@@ -401,6 +406,7 @@ def prerelease_deps(session):
401406
"google-cloud-testutils",
402407
"psutil",
403408
"pytest",
409+
"pytest-xdist",
404410
"pytest-cov",
405411
)
406412

@@ -447,18 +453,21 @@ def prerelease_deps(session):
447453
# Run all tests, except a few samples tests which require extra dependencies.
448454
session.run(
449455
"py.test",
456+
"-n=auto",
450457
"tests/unit",
451458
"-W default::PendingDeprecationWarning",
452459
)
453460

454461
session.run(
455462
"py.test",
463+
"-n=auto",
456464
"tests/system",
457465
"-W default::PendingDeprecationWarning",
458466
)
459467

460468
session.run(
461469
"py.test",
470+
"-n=auto",
462471
"samples/tests",
463472
"-W default::PendingDeprecationWarning",
464473
)

0 commit comments

Comments
 (0)