From 0acffad56dda81281075194cd67c461151ad6ef4 Mon Sep 17 00:00:00 2001 From: Dave Gaeddert <dave.gaeddert@gmail.com> Date: Fri, 14 Jun 2024 16:22:51 -0500 Subject: [PATCH] Remove auto services from test command --- bolt-pytest/bolt/pytest/cli.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/bolt-pytest/bolt/pytest/cli.py b/bolt-pytest/bolt/pytest/cli.py index 094517bfe7..5c4d2d287d 100644 --- a/bolt-pytest/bolt/pytest/cli.py +++ b/bolt-pytest/bolt/pytest/cli.py @@ -1,4 +1,3 @@ -import contextlib import os import subprocess import sys @@ -39,21 +38,15 @@ def cli(pytest_args): click.secho(f"Running pytest with APP_ENV={os.environ['APP_ENV']}", bold=True) - # Won't want to start services automatically in some cases... - # may need a better check for this but CI is the primary auto-exclusion - services = ( - Services() if "CI" not in os.environ and Services else contextlib.nullcontext() + result = subprocess.run( + [ + "pytest", + *pytest_args, + ], + env={ + **os.environ, + }, ) - with services: - result = subprocess.run( - [ - "pytest", - *pytest_args, - ], - env={ - **os.environ, - }, - ) if result.returncode: # Can be invoked by pre-commit, so only exit if it fails