Skip to content

Commit

Permalink
chore(python): Detect samples tests in nested directories (#1572)
Browse files Browse the repository at this point in the history
* feat(python): Detecting tests in nested directories.

* Making the glob really recursive
  • Loading branch information
m-strzelczyk authored Sep 13, 2022
1 parent 2e9ac19 commit 7d86a9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions synthtool/gcp/templates/python_samples/noxfile.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 7d86a9b

Please sign in to comment.