summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2013-12-08 06:20:35 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2013-12-08 06:20:35 (GMT)
commit9fe6d86709b0e769602ff55a6e5a202c440b9d8a (patch)
treeec3d7b1b0cbbd15658459e397c6905964c192331 /Lib/test/test_decimal.py
parent774f909489ca1395ba1e3f3a1f3d43495df6cdfe (diff)
downloadcpython-9fe6d86709b0e769602ff55a6e5a202c440b9d8a.zip
cpython-9fe6d86709b0e769602ff55a6e5a202c440b9d8a.tar.gz
cpython-9fe6d86709b0e769602ff55a6e5a202c440b9d8a.tar.bz2
Issue 19572: More silently skipped tests explicitly skipped.
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 54a3615..d67df79 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -290,7 +290,6 @@ class IBMTestCases(unittest.TestCase):
global skip_expected
if skip_expected:
raise unittest.SkipTest
- return
with open(file) as f:
for line in f:
line = line.replace('\r\n', '').replace('\n', '')
@@ -301,7 +300,6 @@ class IBMTestCases(unittest.TestCase):
#Exception raised where there shouldn't have been one.
self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line)
- return
def eval_line(self, s):
if s.find(' -> ') >= 0 and s[:2] != '--' and not s.startswith(' --'):
@@ -461,7 +459,6 @@ class IBMTestCases(unittest.TestCase):
self.assertEqual(myexceptions, theirexceptions,
'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions))
- return
def getexceptions(self):
return [e for e in Signals[self.decimal] if self.context.flags[e]]
@@ -1073,7 +1070,7 @@ class FormatTest(unittest.TestCase):
try:
from locale import CHAR_MAX
except ImportError:
- return
+ self.skipTest('locale.CHAR_MAX not available')
def make_grouping(lst):
return ''.join([chr(x) for x in lst]) if self.decimal == C else lst
@@ -1164,8 +1161,12 @@ class FormatTest(unittest.TestCase):
decimal_point = locale.localeconv()['decimal_point']
thousands_sep = locale.localeconv()['thousands_sep']
- if decimal_point != '\u066b' or thousands_sep != '\u066c':
- return
+ if decimal_point != '\u066b':
+ self.skipTest('inappropriate decimal point separator'
+ '({!r} not {!r})'.format(decimal_point, '\u066b'))
+ if thousands_sep != '\u066c':
+ self.skipTest('inappropriate thousands separator'
+ '({!r} not {!r})'.format(thousands_sep, '\u066c'))
self.assertEqual(format(Decimal('100000000.123'), 'n'),
'100\u066c000\u066c000\u066b123')
@@ -1515,7 +1516,6 @@ def thfunc1(cls):
cls.assertTrue(c1.flags[Inexact])
for sig in Overflow, Underflow, DivisionByZero, InvalidOperation:
cls.assertFalse(c1.flags[sig])
- return
def thfunc2(cls):
Decimal = cls.decimal.Decimal
@@ -1560,7 +1560,6 @@ def thfunc2(cls):
cls.assertTrue(thiscontext.flags[Inexact])
for sig in Overflow, Underflow, DivisionByZero, InvalidOperation:
cls.assertFalse(thiscontext.flags[sig])
- return
class ThreadingTest(unittest.TestCase):
'''Unit tests for thread local contexts in Decimal.'''
@@ -1602,7 +1601,6 @@ class ThreadingTest(unittest.TestCase):
DefaultContext.prec = save_prec
DefaultContext.Emax = save_emax
DefaultContext.Emin = save_emin
- return
@unittest.skipUnless(threading, 'threading required')
class CThreadingTest(ThreadingTest):
@@ -4525,7 +4523,6 @@ class PyWhitebox(unittest.TestCase):
self.assertEqual(d1._sign, b1._sign)
self.assertEqual(d1._int, b1._int)
self.assertEqual(d1._exp, b1._exp)
- return
Decimal(d1)
self.assertEqual(d1._sign, b1._sign)
@@ -5271,7 +5268,7 @@ class CWhitebox(unittest.TestCase):
try:
from locale import CHAR_MAX
except ImportError:
- return
+ self.skipTest('locale.CHAR_MAX not available')
def make_grouping(lst):
return ''.join([chr(x) for x in lst])