1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Replaced subprocess commands by run() wherever possible.

This commit is contained in:
Claude Paroz
2019-08-23 10:53:36 +02:00
committed by Carlton Gibson
parent 7bd9633320
commit 9386586f31
13 changed files with 42 additions and 42 deletions

View File

@@ -4,7 +4,7 @@ import stat
import unittest
from io import StringIO
from pathlib import Path
from subprocess import Popen
from subprocess import run
from unittest import mock
from django.core.management import (
@@ -184,7 +184,7 @@ class CompilationErrorHandling(MessageCompilationTests):
# Make sure the output of msgfmt is unaffected by the current locale.
env = os.environ.copy()
env.update({'LANG': 'C'})
with mock.patch('django.core.management.utils.Popen', lambda *args, **kwargs: Popen(*args, env=env, **kwargs)):
with mock.patch('django.core.management.utils.run', lambda *args, **kwargs: run(*args, env=env, **kwargs)):
cmd = MakeMessagesCommand()
if cmd.gettext_version < (0, 18, 3):
self.skipTest("python-brace-format is a recent gettext addition.")