From 4760d8dce1351d93658cb11d02a1b7ceb23ae5d7 Mon Sep 17 00:00:00 2001 From: Maciej Strzelczyk Date: Wed, 19 Jan 2022 01:28:17 +0100 Subject: [PATCH] chore(python): Noxfile recognizes that tests can live in a folder (#1334) Pytest works just fine with tests organized inside a `tests` folder. I see no reason why we shouldn't accept that. Also, I wanted to put tests in dedicated folder in my samples ;) Tested it locally --- synthtool/gcp/templates/python_samples/noxfile.py.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/synthtool/gcp/templates/python_samples/noxfile.py.j2 b/synthtool/gcp/templates/python_samples/noxfile.py.j2 index 3bbef5d54..20cdfc620 100644 --- a/synthtool/gcp/templates/python_samples/noxfile.py.j2 +++ b/synthtool/gcp/templates/python_samples/noxfile.py.j2 @@ -187,6 +187,7 @@ def _session_tests( ) -> None: # check for presence of tests test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + test_list.extend(glob.glob("tests")) if len(test_list) == 0: print("No tests found, skipping directory.") else: