diff --git a/monitoring/snippets/v3/alerts-client/noxfile.py b/monitoring/snippets/v3/alerts-client/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/monitoring/snippets/v3/alerts-client/noxfile.py +++ b/monitoring/snippets/v3/alerts-client/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/monitoring/snippets/v3/cloud-client/noxfile.py b/monitoring/snippets/v3/cloud-client/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/monitoring/snippets/v3/cloud-client/noxfile.py +++ b/monitoring/snippets/v3/cloud-client/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/monitoring/snippets/v3/uptime-check-client/noxfile.py b/monitoring/snippets/v3/uptime-check-client/noxfile.py index 5fcb9d7461f2..0398d72ff690 100644 --- a/monitoring/snippets/v3/uptime-check-client/noxfile.py +++ b/monitoring/snippets/v3/uptime-check-client/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.")