Skip to content

Commit e9afe79

Browse files
partheagcf-owl-bot[bot]harkamaljot
authored
tests: update default runtime used for tests (#1788)
* tests: update default runtime used for tests * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * also disable 3.7/3.8 samples tests * revert * specify sessions for Kokoro job * update secrets --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Harkamal Jot Singh Kumar <harkamalj@google.com>
1 parent 474485d commit e9afe79

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed
File renamed without changes.

noxfile.py

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,33 @@
3333
"docs/conf.py",
3434
]
3535

36+
DEFAULT_PYTHON_VERSION = "3.10"
37+
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1787):
38+
# Remove or restore testing for Python 3.7/3.8
39+
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
40+
41+
# Error if a python version is missing
42+
nox.options.error_on_missing_interpreters = True
43+
44+
# pypy will be run as a github action instead of through Kokoro
45+
nox.options.sessions = [
46+
"lint",
47+
"blacken",
48+
"mypy",
49+
# TODO(https://github.com/googleapis/google-auth-library-python/issues/1787):
50+
# Remove or restore testing for Python 3.7/3.8
51+
"unit-3.9",
52+
"unit-3.10",
53+
"unit-3.11",
54+
"unit-3.12",
55+
"unit-3.13",
56+
# cover must be last to avoid error `No data to report`
57+
"cover",
58+
"docs",
59+
]
60+
3661

37-
@nox.session(python="3.8")
62+
@nox.session(python=DEFAULT_PYTHON_VERSION)
3863
def lint(session):
3964
session.install(
4065
"flake8", "flake8-import-order", "docutils", CLICK_VERSION, BLACK_VERSION
@@ -54,7 +79,7 @@ def lint(session):
5479
)
5580

5681

57-
@nox.session(python="3.8")
82+
@nox.session(python=DEFAULT_PYTHON_VERSION)
5883
def blacken(session):
5984
"""Run black.
6085
Format code to uniform standard.
@@ -67,7 +92,7 @@ def blacken(session):
6792
session.run("black", *BLACK_PATHS)
6893

6994

70-
@nox.session(python="3.8")
95+
@nox.session(python=DEFAULT_PYTHON_VERSION)
7196
def mypy(session):
7297
"""Verify type hints are mypy compatible."""
7398
session.install("-e", ".")
@@ -84,7 +109,7 @@ def mypy(session):
84109
session.run("mypy", "-p", "google", "-p", "tests", "-p", "tests_async")
85110

86111

87-
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
112+
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
88113
def unit(session):
89114
constraints_path = str(
90115
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
@@ -102,7 +127,7 @@ def unit(session):
102127
)
103128

104129

105-
@nox.session(python="3.8")
130+
@nox.session(python=DEFAULT_PYTHON_VERSION)
106131
def cover(session):
107132
session.install("-e", ".[testing]")
108133
session.run(

system_tests/noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ def configure_cloud_sdk(session, application_default_credentials, project=False)
163163

164164
TEST_DEPENDENCIES_ASYNC = ["aiohttp", "pytest-asyncio", "nest-asyncio", "mock"]
165165
TEST_DEPENDENCIES_SYNC = ["pytest", "requests", "mock", "pyjwt"]
166-
PYTHON_VERSIONS_ASYNC = ["3.7"]
167-
PYTHON_VERSIONS_SYNC = ["3.7"]
166+
PYTHON_VERSIONS_ASYNC = ["3.10"]
167+
PYTHON_VERSIONS_SYNC = ["3.10"]
168168

169169

170170
def default(session, *test_paths):

0 commit comments

Comments
 (0)