Skip to content

Commit e9ed704

Browse files
chore: detect samples tests in nested directories (#79)
Source-Link: googleapis/synthtool@50db768 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6c81459 commit e9ed704

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

optimization/snippets/noxfile.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ def _session_tests(
208208
session: nox.sessions.Session, post_install: Callable = None
209209
) -> None:
210210
# check for presence of tests
211-
test_list = glob.glob("*_test.py") + glob.glob("test_*.py")
212-
test_list.extend(glob.glob("tests"))
211+
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob(
212+
"**/test_*.py", recursive=True
213+
)
214+
test_list.extend(glob.glob("**/tests", recursive=True))
213215

214216
if len(test_list) == 0:
215217
print("No tests found, skipping directory.")

0 commit comments

Comments
 (0)