[Python-checkins] r81799 - in python/branches/py3k-cdecimal: Lib/test/decimal_tests.py setup.py
stefan.krah
python-checkins at python.org
Mon Jun 7 15:10:10 CEST 2010
Author: stefan.krah
Date: Mon Jun 7 15:10:10 2010
New Revision: 81799
Log:
1) If Python is compiled --without-threads, use the faster non-threaded
version.
2) Fix bugs in skipping tests.
Modified:
python/branches/py3k-cdecimal/Lib/test/decimal_tests.py
python/branches/py3k-cdecimal/setup.py
Modified: python/branches/py3k-cdecimal/Lib/test/decimal_tests.py
==============================================================================
--- python/branches/py3k-cdecimal/Lib/test/decimal_tests.py (original)
+++ python/branches/py3k-cdecimal/Lib/test/decimal_tests.py Mon Jun 7 15:10:10 2010
@@ -1362,17 +1362,11 @@
cls.assertFalse(thiscontext.flags[sig])
return
+ at unittest.skipUnless(threading, 'threading required')
class DecimalUseOfContextTest(unittest.TestCase):
- '''Unit tests for Use of Context cases in Decimal.'''
-
- try:
- import threading
- except ImportError:
- self.skipTest("importing threading failed")
# Take care executing this test from IDLE, there's an issue in threading
# that hangs IDLE and I couldn't find it
-
def test_threading(self):
if HAVE_CDECIMAL and not HAVE_THREADS:
self.skipTest("compiled without threading")
@@ -1507,8 +1501,7 @@
])
if HAVE_CDECIMAL:
- self.skipTest("new hashing scheme and float comparisons not "
- "implemented yet")
+ self.skipTest("new hashing scheme: not yet implemented")
# check that hash(d) == hash(int(d)) for integral values
for value in test_values:
self.assertEqual(hash(value), hash(int(value)))
Modified: python/branches/py3k-cdecimal/setup.py
==============================================================================
--- python/branches/py3k-cdecimal/setup.py (original)
+++ python/branches/py3k-cdecimal/setup.py Mon Jun 7 15:10:10 2010
@@ -1751,7 +1751,8 @@
else:
raise DistutilsError("cdecimal: unsupported architecture")
# Faster version without thread local contexts:
- # define_macros.append(('WITHOUT_THREADS', 1))
+ if '--without-threads' in sysconfig.get_config_var('CONFIG_ARGS'):
+ define_macros.append(('WITHOUT_THREADS', 1))
if 'sunos' in platform and cc == 'cc': # suncc
extra_compile_args.extend(['-erroff=E_ARGUEMENT_MISMATCH']) # [sic]
ext = Extension (
More information about the Python-checkins
mailing list