

def test_none_entity(self):
    (s, (u1, u2, u3, u4)) = self._fixture()
    User = self.classes.User
    ua = aliased(User)
    q = s.query(User, ua)
    kt = (lambda *x: KeyedTuple(x, ['User', 'useralias']))
    collection = [kt(u1, u2), kt(u1, None), kt(u2, u3)]
    it = loading.merge_result(q, collection)
    eq_([(((x and x.id) or None), ((y and y.id) or None)) for (x, y) in it], [(u1.id, u2.id), (u1.id, None), (u2.id, u4.id)])

dataset/ETHPy150Open zzzeek/sqlalchemy/test/orm/test_loading.py MergeResultTest.test_none_entity/VarMisuse@173/190 `u3`->`u4`