Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1d21b26d
Commit
1d21b26d
authored
Sep 28, 2012
by
Stefan Krah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16080: Use run_with_locale() decorator to reset the locale properly.
parent
117083c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
Lib/test/test_decimal.py
Lib/test/test_decimal.py
+3
-7
No files found.
Lib/test/test_decimal.py
View file @
1d21b26d
...
...
@@ -34,7 +34,8 @@ import numbers
import
locale
from
test.support
import
(
run_unittest
,
run_doctest
,
is_resource_enabled
,
requires_IEEE_754
)
from
test.support
import
check_warnings
,
import_fresh_module
,
TestFailed
from
test.support
import
(
check_warnings
,
import_fresh_module
,
TestFailed
,
run_with_locale
)
import
random
import
time
import
warnings
...
...
@@ -1136,18 +1137,13 @@ class FormatTest(unittest.TestCase):
self
.
assertEqual
(
get_fmt
(
Decimal
(
'-1.5'
),
dotsep_wide
,
'020n'
),
'-0
\
u00b4
000
\
u00b4
000
\
u00b4
000
\
u00b4
001
\
u00bf
5'
)
@
run_with_locale
(
'LC_ALL'
,
'ps_AF'
)
def
test_wide_char_separator_decimal_point
(
self
):
# locale with wide char separator and decimal point
Decimal
=
self
.
decimal
.
Decimal
try
:
locale
.
setlocale
(
locale
.
LC_ALL
,
'ps_AF'
)
except
locale
.
Error
:
return
self
.
assertEqual
(
format
(
Decimal
(
'100000000.123'
),
'n'
),
'100
\
u066c
000
\
u066c
000
\
u066b
123'
)
locale
.
resetlocale
()
class
CFormatTest
(
FormatTest
):
decimal
=
C
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment