mirror of https://github.com/python/cpython
Make unit tests pass: replace apply() and adapt to different attribute message.
This commit is contained in:
parent
512ab9f8d3
commit
3b843ccf69
|
@ -39,13 +39,13 @@ Time = datetime.time
|
||||||
Timestamp = datetime.datetime
|
Timestamp = datetime.datetime
|
||||||
|
|
||||||
def DateFromTicks(ticks):
|
def DateFromTicks(ticks):
|
||||||
return apply(Date, time.localtime(ticks)[:3])
|
return Date(*time.localtime(ticks)[:3])
|
||||||
|
|
||||||
def TimeFromTicks(ticks):
|
def TimeFromTicks(ticks):
|
||||||
return apply(Time, time.localtime(ticks)[3:6])
|
return Time(*time.localtime(ticks)[3:6])
|
||||||
|
|
||||||
def TimestampFromTicks(ticks):
|
def TimestampFromTicks(ticks):
|
||||||
return apply(Timestamp, time.localtime(ticks)[:6])
|
return Timestamp(*time.localtime(ticks)[:6])
|
||||||
|
|
||||||
version_info = tuple([int(x) for x in version.split(".")])
|
version_info = tuple([int(x) for x in version.split(".")])
|
||||||
sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")])
|
sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")])
|
||||||
|
|
|
@ -280,7 +280,7 @@ class AggregateTests(unittest.TestCase):
|
||||||
cur.execute("select nostep(t) from test")
|
cur.execute("select nostep(t) from test")
|
||||||
self.fail("should have raised an AttributeError")
|
self.fail("should have raised an AttributeError")
|
||||||
except AttributeError, e:
|
except AttributeError, e:
|
||||||
self.failUnlessEqual(e.args[0], "AggrNoStep instance has no attribute 'step'")
|
self.failUnlessEqual(e.args[0], "'AggrNoStep' object has no attribute 'step'")
|
||||||
|
|
||||||
def CheckAggrNoFinalize(self):
|
def CheckAggrNoFinalize(self):
|
||||||
cur = self.con.cursor()
|
cur = self.con.cursor()
|
||||||
|
|
Loading…
Reference in New Issue