We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4124f7d commit e9802aaCopy full SHA for e9802aa
tests/test_codecs.py
@@ -513,6 +513,19 @@ async def test_numeric(self):
513
514
self.assertEqual(str(res), case)
515
516
+ try:
517
+ await self.con.execute(
518
+ '''
519
+ CREATE TABLE tab (v numeric(3, 2));
520
+ INSERT INTO tab VALUES (0), (1);
521
+ ''')
522
+ res = await self.con.fetchval("SELECT v FROM tab WHERE v = $1", 0)
523
+ self.assertEqual(str(res), '0.00')
524
+ res = await self.con.fetchval("SELECT v FROM tab WHERE v = $1", 1)
525
+ self.assertEqual(str(res), '1.00')
526
+ finally:
527
+ await self.con.execute('DROP TABLE tab')
528
+
529
res = await self.con.fetchval(
530
"SELECT $1::numeric", decimal.Decimal('NaN'))
531
self.assertTrue(res.is_nan())
0 commit comments