summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-08-18 18:57:05 +0000
committerJason Kirtland <jek@discorporate.us>2008-08-18 18:57:05 +0000
commitee7366611bb8b40609f7fa4c3eb1b6db17a92db9 (patch)
tree61cc07a2b8493b623ec91f5931ee04e188bed18a /test
parent5ba782841e4d10533632ba15822a4a12e22f2c7b (diff)
downloadsqlalchemy-ee7366611bb8b40609f7fa4c3eb1b6db17a92db9.tar.gz
attributes.get_history now reports some zero-length slots as the empty tuple rather than an empty list. nice speed boost and memory reduction.
Diffstat (limited to 'test')
-rw-r--r--test/orm/attributes.py146
-rw-r--r--test/orm/expire.py2
-rw-r--r--test/orm/extendedattr.py8
3 files changed, 78 insertions, 78 deletions
diff --git a/test/orm/attributes.py b/test/orm/attributes.py
index 327a3efd3..eddf48cfe 100644
--- a/test/orm/attributes.py
+++ b/test/orm/attributes.py
@@ -334,11 +334,11 @@ class AttributesTest(_base.ORMTest):
el = Element()
x = Bar()
x.element = el
- eq_(attributes.get_history(attributes.instance_state(x), 'element'), ([el],[], []))
+ eq_(attributes.get_history(attributes.instance_state(x), 'element'), ([el], (), ()))
attributes.instance_state(x).commit_all()
(added, unchanged, deleted) = attributes.get_history(attributes.instance_state(x), 'element')
- assert added == []
+ assert added == ()
assert unchanged == [el]
def test_lazyhistory(self):
@@ -714,55 +714,55 @@ class HistoryTest(_base.ORMTest):
# case 1. new object
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), (), ()))
f.someattr = "hi"
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['hi'], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['hi'], (), ()))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['hi'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['hi'], ()))
f.someattr = 'there'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['there'], [], ['hi']))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['there'], (), ['hi']))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['there'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['there'], ()))
del f.someattr
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], ['there']))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), (), ['there']))
# case 2. object with direct dictionary settings (similar to a load operation)
f = Foo()
f.__dict__['someattr'] = 'new'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['new'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['new'], ()))
f.someattr = 'old'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['old'], [], ['new']))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['old'], (), ['new']))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['old'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['old'], ()))
# setting None on uninitialized is currently a change for a scalar attribute
# no lazyload occurs so this allows overwrite operation to proceed
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), (), ()))
f.someattr = None
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], (), ()))
f = Foo()
f.__dict__['someattr'] = 'new'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['new'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['new'], ()))
f.someattr = None
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], [], ['new']))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], (), ['new']))
# set same value twice
f = Foo()
attributes.instance_state(f).commit(['someattr'])
f.someattr = 'one'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['one'], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['one'], (), ()))
f.someattr = 'two'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['two'], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['two'], (), ()))
def test_mutable_scalar(self):
@@ -774,33 +774,33 @@ class HistoryTest(_base.ORMTest):
# case 1. new object
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), (), ()))
f.someattr = {'foo':'hi'}
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([{'foo':'hi'}], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([{'foo':'hi'}], (), ()))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [{'foo':'hi'}], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [{'foo':'hi'}], ()))
eq_(attributes.instance_state(f).committed_state['someattr'], {'foo':'hi'})
f.someattr['foo'] = 'there'
eq_(attributes.instance_state(f).committed_state['someattr'], {'foo':'hi'})
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([{'foo':'there'}], [], [{'foo':'hi'}]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([{'foo':'there'}], (), [{'foo':'hi'}]))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [{'foo':'there'}], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [{'foo':'there'}], ()))
# case 2. object with direct dictionary settings (similar to a load operation)
f = Foo()
f.__dict__['someattr'] = {'foo':'new'}
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [{'foo':'new'}], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [{'foo':'new'}], ()))
f.someattr = {'foo':'old'}
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([{'foo':'old'}], [], [{'foo':'new'}]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([{'foo':'old'}], (), [{'foo':'new'}]))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [{'foo':'old'}], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [{'foo':'old'}], ()))
def test_use_object(self):
@@ -822,56 +822,56 @@ class HistoryTest(_base.ORMTest):
# case 1. new object
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [None], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [None], ()))
f.someattr = hi
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([hi], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([hi], (), ()))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [hi], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [hi], ()))
f.someattr = there
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([there], [], [hi]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([there], (), [hi]))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [there], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [there], ()))
del f.someattr
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], [], [there]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], (), [there]))
# case 2. object with direct dictionary settings (similar to a load operation)
f = Foo()
f.__dict__['someattr'] = 'new'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['new'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['new'], ()))
f.someattr = old
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([old], [], ['new']))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([old], (), ['new']))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [old], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [old], ()))
# setting None on uninitialized is currently not a change for an object attribute
# (this is different than scalar attribute). a lazyload has occured so if its
# None, its really None
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [None], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [None], ()))
f.someattr = None
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [None], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [None], ()))
f = Foo()
f.__dict__['someattr'] = 'new'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], ['new'], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), ['new'], ()))
f.someattr = None
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], [], ['new']))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([None], (), ['new']))
# set same value twice
f = Foo()
attributes.instance_state(f).commit(['someattr'])
f.someattr = 'one'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['one'], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['one'], (), ()))
f.someattr = 'two'
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['two'], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), (['two'], (), ()))
def test_object_collections_set(self):
class Foo(_base.BasicEntity):
@@ -890,20 +890,20 @@ class HistoryTest(_base.ORMTest):
# case 1. new object
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [], ()))
f.someattr = [hi]
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([hi], [], []))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [hi], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [hi], ()))
f.someattr = [there]
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([there], [], [hi]))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [there], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [there], ()))
f.someattr = [hi]
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([hi], [], [there]))
@@ -916,13 +916,13 @@ class HistoryTest(_base.ORMTest):
collection = attributes.init_collection(attributes.instance_state(f), 'someattr')
collection.append_without_event(new)
attributes.instance_state(f).commit_all()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [new], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [new], ()))
f.someattr = [old]
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([old], [], [new]))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [old], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [old], ()))
def test_dict_collections(self):
class Foo(_base.BasicEntity):
@@ -941,16 +941,16 @@ class HistoryTest(_base.ORMTest):
new = Bar(name='new')
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [], ()))
f.someattr['hi'] = hi
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([hi], [], []))
f.someattr['there'] = there
- eq_(tuple([set(x) for x in attributes.get_history(attributes.instance_state(f), 'someattr')]), (set([hi, there]), set([]), set([])))
+ eq_(tuple([set(x) for x in attributes.get_history(attributes.instance_state(f), 'someattr')]), (set([hi, there]), set(), set()))
attributes.instance_state(f).commit(['someattr'])
- eq_(tuple([set(x) for x in attributes.get_history(attributes.instance_state(f), 'someattr')]), (set([]), set([hi, there]), set([])))
+ eq_(tuple([set(x) for x in attributes.get_history(attributes.instance_state(f), 'someattr')]), (set(), set([hi, there]), set()))
def test_object_collections_mutate(self):
class Foo(_base.BasicEntity):
@@ -969,20 +969,20 @@ class HistoryTest(_base.ORMTest):
# case 1. new object
f = Foo(id=1)
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [], ()))
f.someattr.append(hi)
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([hi], [], []))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [hi], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [hi], ()))
f.someattr.append(there)
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([there], [hi], []))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [hi, there], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [hi, there], ()))
f.someattr.remove(there)
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [hi], [there]))
@@ -991,7 +991,7 @@ class HistoryTest(_base.ORMTest):
f.someattr.append(new)
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([old, new], [hi], [there]))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [hi, old, new], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [hi, old, new], ()))
f.someattr.pop(0)
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [old, new], [hi]))
@@ -1002,19 +1002,19 @@ class HistoryTest(_base.ORMTest):
collection = attributes.init_collection(attributes.instance_state(f), 'someattr')
collection.append_without_event(new)
attributes.instance_state(f).commit_all()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [new], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [new], ()))
f.someattr.append(old)
eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([old], [new], []))
attributes.instance_state(f).commit(['someattr'])
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [new, old], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [new, old], ()))
f = Foo()
collection = attributes.init_collection(attributes.instance_state(f), 'someattr')
collection.append_without_event(new)
attributes.instance_state(f).commit_all()
- eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ([], [new], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'someattr'), ((), [new], ()))
f.id = 1
f.someattr.remove(new)
@@ -1042,19 +1042,19 @@ class HistoryTest(_base.ORMTest):
f1 = Foo()
b1 = Bar()
- eq_(attributes.get_history(attributes.instance_state(f1), 'bars'), ([], [], []))
- eq_(attributes.get_history(attributes.instance_state(b1), 'foo'), ([], [None], []))
+ eq_(attributes.get_history(attributes.instance_state(f1), 'bars'), ((), [], ()))
+ eq_(attributes.get_history(attributes.instance_state(b1), 'foo'), ((), [None], ()))
#b1.foo = f1
f1.bars.append(b1)
eq_(attributes.get_history(attributes.instance_state(f1), 'bars'), ([b1], [], []))
- eq_(attributes.get_history(attributes.instance_state(b1), 'foo'), ([f1], [], []))
+ eq_(attributes.get_history(attributes.instance_state(b1), 'foo'), ([f1], (), ()))
b2 = Bar()
f1.bars.append(b2)
eq_(attributes.get_history(attributes.instance_state(f1), 'bars'), ([b1, b2], [], []))
- eq_(attributes.get_history(attributes.instance_state(b1), 'foo'), ([f1], [], []))
- eq_(attributes.get_history(attributes.instance_state(b2), 'foo'), ([f1], [], []))
+ eq_(attributes.get_history(attributes.instance_state(b1), 'foo'), ([f1], (), ()))
+ eq_(attributes.get_history(attributes.instance_state(b2), 'foo'), ([f1], (), ()))
def test_lazy_backref_collections(self):
class Foo(_base.BasicEntity):
@@ -1089,7 +1089,7 @@ class HistoryTest(_base.ORMTest):
lazy_load = [bar1, bar2, bar3]
attributes.instance_state(f).expire_attributes(['bars'])
- eq_(attributes.get_history(attributes.instance_state(f), 'bars'), ([], [bar1, bar2, bar3], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bars'), ((), [bar1, bar2, bar3], ()))
def test_collections_via_lazyload(self):
class Foo(_base.BasicEntity):
@@ -1152,24 +1152,24 @@ class HistoryTest(_base.ORMTest):
f = Foo()
eq_(f.bar, "hi")
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([], ["hi"], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ((), ["hi"], ()))
f = Foo()
f.bar = None
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], (), ()))
f = Foo()
f.bar = "there"
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), (["there"], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), (["there"], (), ()))
f.bar = "hi"
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), (["hi"], [], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), (["hi"], (), ()))
f = Foo()
eq_(f.bar, "hi")
del f.bar
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([], [], ["hi"]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ((), (), ["hi"]))
assert f.bar is None
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], [], ["hi"]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], (), ["hi"]))
def test_scalar_object_via_lazyload(self):
class Foo(_base.BasicEntity):
@@ -1193,24 +1193,24 @@ class HistoryTest(_base.ORMTest):
# operations
f = Foo()
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([], [bar1], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ((), [bar1], ()))
f = Foo()
f.bar = None
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], [], [bar1]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], (), [bar1]))
f = Foo()
f.bar = bar2
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([bar2], [], [bar1]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([bar2], (), [bar1]))
f.bar = bar1
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([], [bar1], []))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ((), [bar1], ()))
f = Foo()
eq_(f.bar, bar1)
del f.bar
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], [], [bar1]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], (), [bar1]))
assert f.bar is None
- eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], [], [bar1]))
+ eq_(attributes.get_history(attributes.instance_state(f), 'bar'), ([None], (), [bar1]))
if __name__ == "__main__":
diff --git a/test/orm/expire.py b/test/orm/expire.py
index df456fb58..3cb7101e5 100644
--- a/test/orm/expire.py
+++ b/test/orm/expire.py
@@ -731,7 +731,7 @@ class PolymorphicExpireTest(_base.MappedTest):
assert e1.status == 'new engineer'
assert e2.status == 'old engineer'
self.assert_sql_count(testing.db, go, 2)
- self.assertEquals(Engineer.name.get_history(e1), (['new engineer name'], [], ['engineer1']))
+ self.assertEquals(Engineer.name.get_history(e1), (['new engineer name'],(), ['engineer1']))
class RefreshTest(_fixtures.FixtureTest):
diff --git a/test/orm/extendedattr.py b/test/orm/extendedattr.py
index 2f4d9ab5e..8602f2681 100644
--- a/test/orm/extendedattr.py
+++ b/test/orm/extendedattr.py
@@ -250,7 +250,7 @@ class UserDefinedExtensionTest(_base.ORMTest):
f1 = Foo()
f1.name = 'f1'
- self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'name'), (['f1'], [], []))
+ self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'name'), (['f1'], (), ()))
b1 = Bar()
b1.name = 'b1'
@@ -260,14 +260,14 @@ class UserDefinedExtensionTest(_base.ORMTest):
attributes.instance_state(f1).commit_all()
attributes.instance_state(b1).commit_all()
- self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'name'), ([], ['f1'], []))
- self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'bars'), ([], [b1], []))
+ self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'name'), ((), ['f1'], ()))
+ self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'bars'), ((), [b1], ()))
f1.name = 'f1mod'
b2 = Bar()
b2.name = 'b2'
f1.bars.append(b2)
- self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'name'), (['f1mod'], [], ['f1']))
+ self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'name'), (['f1mod'], (), ['f1']))
self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'bars'), ([b2], [b1], []))
f1.bars.remove(b1)
self.assertEquals(attributes.get_history(attributes.instance_state(f1), 'bars'), ([b2], [], [b1]))