Skip to content

Commit

Permalink
tests: raise command error with exit code if non-zero (bug 1887042) (#54
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zzzeid authored May 3, 2024
1 parent c52e80b commit d067fd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lando/utils/management/commands/tests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import subprocess

from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.management.base import BaseCommand, CommandError

ROOT_DIR = settings.BASE_DIR.parent.parent

Expand Down Expand Up @@ -30,4 +30,6 @@ def handle(self, *args, **options):
if options["paths"]:
command += options["paths"]

subprocess.call(command, cwd=ROOT_DIR)
exit_code = subprocess.call(command, cwd=ROOT_DIR)
if exit_code:
raise CommandError(f"Pytest exited with exit code {exit_code}")

0 comments on commit d067fd6

Please sign in to comment.