test_types_basic.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:psycopg2-for-aws-lambda 作者: iwitaly 项目源码 文件源码
def testFloatInf(self):
        try:
            self.execute("select 'inf'::float")
        except psycopg2.DataError:
            return self.skipTest("inf::float not available on the server")
        except ValueError:
            return self.skipTest("inf not available on this platform")
        s = self.execute("SELECT %s AS foo", (float("inf"),))
        self.assertTrue(str(s) == "inf", "wrong float quoting: " + str(s))
        self.assertTrue(type(s) == float, "wrong float conversion: " + repr(s))

        s = self.execute("SELECT %s AS foo", (float("-inf"),))
        self.assertTrue(str(s) == "-inf", "wrong float quoting: " + str(s))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号