Skip to content

Commit

Permalink
chore: detect samples tests in nested directories (#79)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 13, 2022
1 parent 7fd81b8 commit 58f8f4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:993a058718e84a82fda04c3177e58f0a43281a996c7c395e0a56ccc4d6d210d7
digest: sha256:e09366bdf0fd9c8976592988390b24d53583dd9f002d476934da43725adbb978
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ 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 58f8f4f

Please sign in to comment.