Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b3e39a2
Add localeconv function to locale module
minhrongcon2000 Feb 24, 2023
1ed1b29
Fix potential infinite loop
minhrongcon2000 Feb 24, 2023
7e9390c
Skip locale test
minhrongcon2000 Feb 24, 2023
b2c1e5f
Refactor and add platform def for localeconv
minhrongcon2000 Feb 24, 2023
0dd95e0
Add missing platform def on constant
minhrongcon2000 Feb 24, 2023
65f5036
Fix wrong format
minhrongcon2000 Feb 24, 2023
359c696
Fix platform dependent error build
minhrongcon2000 Feb 24, 2023
1533f7b
Add platform def at the top of locale module
minhrongcon2000 Feb 24, 2023
09c750c
Refactor code
minhrongcon2000 Feb 24, 2023
844a30a
Fix mismatch typing
minhrongcon2000 Feb 24, 2023
26f103a
Use libc::c_char instead
minhrongcon2000 Feb 24, 2023
9374005
Fix skip test reason for locale
minhrongcon2000 Feb 24, 2023
757545f
Add setlocale function
minhrongcon2000 Feb 24, 2023
184f891
Merge commit '757545fe37c347c75a5734e0fa9ef9d13a3bcce8' into fix/add-…
minhrongcon2000 Feb 25, 2023
ecc21e8
Fix clippy requirements
minhrongcon2000 Feb 25, 2023
973d2b2
Fix rustfmt issues
minhrongcon2000 Feb 25, 2023
2d37933
Remove test_locale skip testcase
minhrongcon2000 Feb 25, 2023
082d1ef
Fix unittest
minhrongcon2000 Feb 25, 2023
f5730c4
Fix clippy issues
minhrongcon2000 Feb 25, 2023
31941a4
Clean up locale module code
minhrongcon2000 Feb 25, 2023
0c5ecb5
Remove setlocale test expected failure
minhrongcon2000 Feb 25, 2023
26f04e2
Skip format and strcol test case
minhrongcon2000 Feb 28, 2023
0268af5
Fix skpTest bug
minhrongcon2000 Feb 28, 2023
44a36af
Skip locale test for window
minhrongcon2000 Feb 28, 2023
9801409
Fix test locale skip convention
minhrongcon2000 Feb 28, 2023
fcfa35a
Revert original skip decorator and polish code
minhrongcon2000 Feb 28, 2023
a44a593
Allow test_strcoll_3303
minhrongcon2000 Feb 28, 2023
9e5be11
Expect failure instead of skip
minhrongcon2000 Feb 28, 2023
6291ca9
Update Lib/test/test_locale.py
youknowone Feb 28, 2023
38d2253
clean up and additional error handling for NulError
youknowone Feb 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test locale skip convention
  • Loading branch information
minhrongcon2000 committed Feb 28, 2023
commit 98014090fc8f7ca82f0b1eaee15fe456730bbf0e
27 changes: 10 additions & 17 deletions Lib/test/test_locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,24 +375,12 @@ def setUp(self):
raise unittest.SkipTest('wcscoll/wcsxfrm have known bugs')
BaseLocalizedTest.setUp(self)

# @unittest.skipIf(sys.platform.startswith('aix'),
# 'bpo-29972: broken test on AIX')
# @unittest.skipIf(
# is_emscripten or is_wasi,
# "musl libc issue on Emscripten/WASI, bpo-46390"
# )
@unittest.skip("TODO: RUSTPYTHON")
Comment thread
minhrongcon2000 marked this conversation as resolved.
Outdated
def test_strcoll_with_diacritic(self):
self.skipTest("TODO: strcoll hasn't been implemented")
self.assertLess(locale.strcoll('à', 'b'), 0)

# @unittest.skipIf(sys.platform.startswith('aix'),
# 'bpo-29972: broken test on AIX')
# @unittest.skipIf(
# is_emscripten or is_wasi,
# "musl libc issue on Emscripten/WASI, bpo-46390"
# )
@unittest.skip("TODO: RUSTPYTHON")
Comment thread
fanninpm marked this conversation as resolved.
Outdated
def test_strxfrm_with_diacritic(self):
self.skipTest("TODO: strxfrm hasn't been implemented")
self.assertLess(locale.strxfrm('à'), locale.strxfrm('b'))


Expand Down Expand Up @@ -547,6 +535,10 @@ def test_defaults_UTF8(self):

if orig_getlocale is not None:
_locale._getdefaultlocale = orig_getlocale

# TODO: RUSTPYTHON
if sys.platform == "win32":
test_defaults_UTF8 = unittest.expectedFailure(test_defaults_UTF8)

def test_getencoding(self):
# Invoke getencoding to make sure it does not cause exceptions.
Expand All @@ -569,9 +561,6 @@ def test_strcoll_3303(self):
self.assertRaises(TypeError, locale.strcoll, b"a", None)
Comment thread
minhrongcon2000 marked this conversation as resolved.

def test_setlocale_category(self):
if hasattr(sys, "getwindowsversion"):
self.skipTest("TODO: locale has not been implemented for window")

locale.setlocale(locale.LC_ALL)
locale.setlocale(locale.LC_TIME)
locale.setlocale(locale.LC_CTYPE)
Expand All @@ -581,6 +570,10 @@ def test_setlocale_category(self):

# crasher from bug #7419
self.assertRaises(locale.Error, locale.setlocale, 12345)

# TODO: RUSTPYTHON
if sys.platform == "win32":
test_setlocale_category = unittest.expectedFailure(test_setlocale_category)
Comment thread
minhrongcon2000 marked this conversation as resolved.

def test_getsetlocale_issue1813(self):
# Issue #1813: setting and getting the locale under a Turkish locale
Expand Down