summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-11-28 03:05:06 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-11-28 03:05:06 +0000
commitfc8574fdd88288de2435d54d6180a84c646aac9f (patch)
treed6f745e10a4f5521a984ce0d2dc3e2426564399b /tests
parent06d47888114f6f9fd86f306ffccf05caa8741e7b (diff)
parent048f1bb95a8ad3863cdd02cd25a2786c48c8d91f (diff)
downloadpsycopg2-fc8574fdd88288de2435d54d6180a84c646aac9f.tar.gz
Merge remote-tracking branch 'jdufresne/decimal'
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_cursor.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/test_cursor.py b/tests/test_cursor.py
index dbc72e1..e97e817 100755
--- a/tests/test_cursor.py
+++ b/tests/test_cursor.py
@@ -98,11 +98,7 @@ class CursorTests(ConnectingTestCase):
cur.mogrify(u"SELECT %s;", (snowman,)))
def test_mogrify_decimal_explodes(self):
- # issue #7: explodes on windows with python 2.5 and psycopg 2.2.2
- try:
- from decimal import Decimal
- except:
- return
+ from decimal import Decimal
conn = self.conn
cur = conn.cursor()
@@ -138,12 +134,8 @@ class CursorTests(ConnectingTestCase):
self.assertEqual(42, curs.cast(20, '42'))
self.assertAlmostEqual(3.14, curs.cast(700, '3.14'))
- try:
- from decimal import Decimal
- except ImportError:
- self.assertAlmostEqual(123.45, curs.cast(1700, '123.45'))
- else:
- self.assertEqual(Decimal('123.45'), curs.cast(1700, '123.45'))
+ from decimal import Decimal
+ self.assertEqual(Decimal('123.45'), curs.cast(1700, '123.45'))
from datetime import date
self.assertEqual(date(2011, 1, 2), curs.cast(1082, '2011-01-02'))