From 318432b60ae2af9d34abfc5057600326bf24ed6a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 16:22:22 +0000 Subject: [PATCH] chore: detect samples tests in nested directories (#345) Source-Link: https://github.com/googleapis/synthtool/commit/50db768f450a50d7c1fd62513c113c9bb96fd434 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978 --- kms/attestations/noxfile.py | 4 ++-- kms/snippets/noxfile.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kms/attestations/noxfile.py b/kms/attestations/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/kms/attestations/noxfile.py +++ b/kms/attestations/noxfile.py @@ -207,8 +207,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("*_test.py") + glob.glob("test_*.py") - test_list.extend(glob.glob("tests")) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: print("No tests found, skipping directory.") diff --git a/kms/snippets/noxfile.py b/kms/snippets/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/kms/snippets/noxfile.py +++ b/kms/snippets/noxfile.py @@ -207,8 +207,8 @@ def _session_tests( session: nox.sessions.Session, post_install: Callable = None ) -> None: # check for presence of tests - test_list = glob.glob("*_test.py") + glob.glob("test_*.py") - test_list.extend(glob.glob("tests")) + test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True) + test_list.extend(glob.glob("**/tests", recursive=True)) if len(test_list) == 0: print("No tests found, skipping directory.")