Skip to content

Commit b4cc3dd

Browse files
committed
Update test_utf8_mode.py
1 parent 26af09d commit b4cc3dd

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

Lib/test/test_utf8_mode.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def test_xoption(self):
6666
PYTHONLEGACYWINDOWSFSENCODING='1')
6767
self.assertEqual(out, '0')
6868

69-
# TODO: RUSTPYTHON
7069
@unittest.expectedFailure
7170
def test_env_var(self):
7271
code = 'import sys; print(sys.flags.utf8_mode)'
@@ -159,8 +158,6 @@ def test_stdio(self):
159158
'stdout: utf-8/namereplace',
160159
'stderr: utf-8/backslashreplace'])
161160

162-
# TODO: RUSTPYTHON
163-
@unittest.expectedFailure
164161
def test_io(self):
165162
code = textwrap.dedent('''
166163
import sys
@@ -171,7 +168,7 @@ def test_io(self):
171168
filename = __file__
172169

173170
out = self.get_output('-c', code, filename, PYTHONUTF8='1')
174-
self.assertEqual(out, 'UTF-8/strict')
171+
self.assertEqual(out, 'utf-8/strict')
175172

176173
def _check_io_encoding(self, module, encoding=None, errors=None):
177174
filename = __file__
@@ -193,7 +190,7 @@ def _check_io_encoding(self, module, encoding=None, errors=None):
193190
PYTHONUTF8='1')
194191

195192
if not encoding:
196-
encoding = 'UTF-8'
193+
encoding = 'utf-8'
197194
if not errors:
198195
errors = 'strict'
199196
self.assertEqual(out, f'{encoding}/{errors}')
@@ -204,8 +201,6 @@ def check_io_encoding(self, module):
204201
self._check_io_encoding(module,
205202
encoding="latin1", errors="namereplace")
206203

207-
# TODO: RUSTPYTHON
208-
@unittest.expectedFailure
209204
def test_io_encoding(self):
210205
self.check_io_encoding('io')
211206

@@ -215,12 +210,12 @@ def test_pyio_encoding(self):
215210
def test_locale_getpreferredencoding(self):
216211
code = 'import locale; print(locale.getpreferredencoding(False), locale.getpreferredencoding(True))'
217212
out = self.get_output('-X', 'utf8', '-c', code)
218-
self.assertEqual(out, 'UTF-8 UTF-8')
213+
self.assertEqual(out, 'utf-8 utf-8')
219214

220215
for loc in POSIX_LOCALES:
221216
with self.subTest(LC_ALL=loc):
222217
out = self.get_output('-X', 'utf8', '-c', code, LC_ALL=loc)
223-
self.assertEqual(out, 'UTF-8 UTF-8')
218+
self.assertEqual(out, 'utf-8 utf-8')
224219

225220
@unittest.skipIf(MS_WINDOWS, 'test specific to Unix')
226221
def test_cmd_line(self):

0 commit comments

Comments
 (0)