1
0
mirror of https://github.com/django/django.git synced 2025-06-05 11:39:13 +00:00

tests: fix CI

tests: fix windows error encoding

tests: deleted reconfigure of stdout

fix: remove need of reconfigure stdout

chore: removed useless comment
This commit is contained in:
Salvo Polizzi 2024-02-09 09:17:11 +01:00
parent cdda249c48
commit ba2cace188
2 changed files with 5 additions and 4 deletions

View File

@ -4,7 +4,6 @@ import os
import posixpath import posixpath
import shutil import shutil
import stat import stat
import sys
import tempfile import tempfile
from importlib.util import find_spec from importlib.util import find_spec
from urllib.request import build_opener from urllib.request import build_opener
@ -239,8 +238,6 @@ class TemplateCommand(BaseCommand):
else: else:
target = os.path.abspath(target) target = os.path.abspath(target)
# call needed to avoid windows encoding errors
sys.stdout.reconfigure(encoding="utf-8")
self.stdout.write(f"Success! Created {name} at {target}.") self.stdout.write(f"Success! Created {name} at {target}.")
def handle_template(self, template, subdir): def handle_template(self, template, subdir):

View File

@ -2899,7 +2899,11 @@ class StartApp(AdminScriptTestCase):
dirs = { dirs = {
"foo": self.test_dir, "foo": self.test_dir,
# Use a subdirectory so it is outside the PYTHONPATH. # Use a subdirectory so it is outside the PYTHONPATH.
"bar": os.path.join(self.test_dir, "apps/otherdir"), "bar": (
os.path.join(self.test_dir, "apps/otherdir")
if os.name == "posix"
else os.path.join(self.test_dir, "apps\\otherdir")
),
} }
for name_app, dir in dirs.items(): for name_app, dir in dirs.items():
with self.subTest(name_app=name_app, dir=dir): with self.subTest(name_app=name_app, dir=dir):