Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Aug 8, 2024
1 parent a9263f2 commit 92a7c38
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions samples/snippets/data_client/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def blacken(session: nox.sessions.Session) -> None:
# format = isort + black
#


@nox.session
def format(session: nox.sessions.Session) -> None:
"""
Expand Down Expand Up @@ -188,9 +187,7 @@ def _session_tests(
session: nox.sessions.Session, post_install: Callable = None
) -> None:
# check for presence of tests
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob(
"**/test_*.py", recursive=True
)
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:
Expand All @@ -212,7 +209,9 @@ def _session_tests(

if os.path.exists("requirements-test.txt"):
if os.path.exists("constraints-test.txt"):
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
session.install(
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
)
else:
session.install("-r", "requirements-test.txt")
with open("requirements-test.txt") as rtfile:
Expand All @@ -225,9 +224,9 @@ def _session_tests(
post_install(session)

if "pytest-parallel" in packages:
concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"])
concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto'])
elif "pytest-xdist" in packages:
concurrent_args.extend(["-n", "auto"])
concurrent_args.extend(['-n', 'auto'])

session.run(
"pytest",
Expand Down Expand Up @@ -257,7 +256,7 @@ def py(session: nox.sessions.Session) -> None:


def _get_repo_root() -> Optional[str]:
"""Returns the root folder of the project."""
""" Returns the root folder of the project. """
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
p = Path(os.getcwd())
for i in range(10):
Expand Down

0 comments on commit 92a7c38

Please sign in to comment.