Skip to content

Commit

Permalink
Remove auto services from test command
Browse files Browse the repository at this point in the history
  • Loading branch information
davegaeddert committed Jun 14, 2024
1 parent 4f72a40 commit 0acffad
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions bolt-pytest/bolt/pytest/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import contextlib
import os
import subprocess
import sys
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0acffad

Please sign in to comment.