mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #35308 -- Handled OSError when launching code formatters.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
This commit is contained in:
parent
978aae4334
commit
58cc91275a
11 changed files with 110 additions and 10 deletions
|
@ -16,6 +16,8 @@ import unittest
|
|||
from io import StringIO
|
||||
from unittest import mock
|
||||
|
||||
from user_commands.utils import AssertFormatterFailureCaughtContext
|
||||
|
||||
from django import conf, get_version
|
||||
from django.conf import settings
|
||||
from django.core.management import (
|
||||
|
@ -2943,6 +2945,16 @@ class StartProject(LiveServerTestCase, AdminScriptTestCase):
|
|||
expected_mode,
|
||||
)
|
||||
|
||||
def test_failure_to_format_code(self):
|
||||
with AssertFormatterFailureCaughtContext(self) as ctx:
|
||||
call_command(
|
||||
"startapp",
|
||||
"mynewapp",
|
||||
directory=self.test_dir,
|
||||
stdout=ctx.stdout,
|
||||
stderr=ctx.stderr,
|
||||
)
|
||||
|
||||
|
||||
class StartApp(AdminScriptTestCase):
|
||||
def test_invalid_name(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue