|
34 | 34 |
|
35 | 35 | DEFAULT_PYTHON_VERSION = "3.14" |
36 | 36 |
|
37 | | -UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 37 | +UNIT_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] |
| 38 | + |
| 39 | +ALL_PYTHON = list(UNIT_TEST_PYTHON_VERSIONS) |
| 40 | +ALL_PYTHON.extend(["3.7"]) |
| 41 | + |
38 | 42 | UNIT_TEST_STANDARD_DEPENDENCIES = [ |
39 | 43 | "mock", |
40 | 44 | "asyncmock", |
@@ -220,7 +224,7 @@ def default(session): |
220 | 224 | ) |
221 | 225 |
|
222 | 226 |
|
223 | | -@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) |
| 227 | +@nox.session(python=ALL_PYTHON) |
224 | 228 | @_calculate_duration |
225 | 229 | def unit(session): |
226 | 230 | """Run the unit test suite.""" |
@@ -272,6 +276,10 @@ def system(session): |
272 | 276 | # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true. |
273 | 277 | if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false": |
274 | 278 | session.skip("RUN_SYSTEM_TESTS is set to false, skipping") |
| 279 | + |
| 280 | + if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS"): |
| 281 | + session.skip("Credentials are required to run system tests") |
| 282 | + |
275 | 283 | # Install pyopenssl for mTLS testing. |
276 | 284 | if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true": |
277 | 285 | session.install("pyopenssl") |
@@ -310,7 +318,7 @@ def system(session): |
310 | 318 |
|
311 | 319 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
312 | 320 | @_calculate_duration |
313 | | -def prerelease(session): |
| 321 | +def prerelease_deps(session): |
314 | 322 | session.install( |
315 | 323 | # https://arrow.apache.org/docs/developers/python.html#installing-nightly-packages |
316 | 324 | "--extra-index-url", |
@@ -388,14 +396,19 @@ def prerelease(session): |
388 | 396 | *session.posargs, |
389 | 397 | ) |
390 | 398 |
|
391 | | - session.run( |
392 | | - "py.test", |
393 | | - "--quiet", |
394 | | - "-W default::PendingDeprecationWarning", |
395 | | - f"--junitxml=prerelease_system_{session.python}_sponge_log.xml", |
396 | | - os.path.join("tests", "system"), |
397 | | - *session.posargs, |
398 | | - ) |
| 399 | + if os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): |
| 400 | + session.run( |
| 401 | + "py.test", |
| 402 | + "--quiet", |
| 403 | + "-W default::PendingDeprecationWarning", |
| 404 | + f"--junitxml=prerelease_system_{session.python}_sponge_log.xml", |
| 405 | + os.path.join("tests", "system"), |
| 406 | + *session.posargs, |
| 407 | + ) |
| 408 | + else: |
| 409 | + session.log( |
| 410 | + "Skipping system tests because GOOGLE_APPLICATION_CREDENTIALS is not set." |
| 411 | + ) |
399 | 412 |
|
400 | 413 |
|
401 | 414 | @nox.session(python=DEFAULT_PYTHON_VERSION) |
@@ -502,3 +515,21 @@ def docfx(session): |
502 | 515 | os.path.join("docs", ""), |
503 | 516 | os.path.join("docs", "_build", "html", ""), |
504 | 517 | ) |
| 518 | + |
| 519 | + |
| 520 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
| 521 | +def mypy(session): |
| 522 | + """Run the type checker.""" |
| 523 | + # TODO(https://github.com/googleapis/google-cloud-python/issues/16014): |
| 524 | + # Add mypy tests |
| 525 | + session.skip("mypy tests are not yet supported") |
| 526 | + |
| 527 | + |
| 528 | +@nox.session(python=DEFAULT_PYTHON_VERSION) |
| 529 | +def core_deps_from_source(session): |
| 530 | + """Run all tests with core dependencies installed from source |
| 531 | + rather than pulling the dependencies from PyPI. |
| 532 | + """ |
| 533 | + # TODO(https://github.com/googleapis/google-cloud-python/issues/16014): |
| 534 | + # Add core deps from source tests |
| 535 | + session.skip("Core deps from source tests are not yet supported") |
0 commit comments