diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-01 18:24:35 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-08-01 18:24:35 -0400 |
commit | c09b79d61eaba130efcd676db5e27ac3635535d2 (patch) | |
tree | 689b89d21811d0fb880f0e69a5d028178a589c21 /test/orm/inheritance/test_basic.py | |
parent | 62b12e4266e5d2305f7dbc17b44bab6b2b05c622 (diff) | |
download | sqlalchemy-c09b79d61eaba130efcd676db5e27ac3635535d2.tar.gz |
- The name ConcurrentModificationError has been
changed to StaleDataError, and descriptive
error messages have been revised to reflect
exactly what the issue is. Both names will
remain available for the forseeable future
for schemes that may be specifying
ConcurrentModificationError in an "except:"
clause.
Diffstat (limited to 'test/orm/inheritance/test_basic.py')
-rw-r--r-- | test/orm/inheritance/test_basic.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/orm/inheritance/test_basic.py b/test/orm/inheritance/test_basic.py index 2f9295e17..7607bd082 100644 --- a/test/orm/inheritance/test_basic.py +++ b/test/orm/inheritance/test_basic.py @@ -605,14 +605,14 @@ class VersioningTest(_base.MappedTest): sess.flush() - assert_raises(orm_exc.ConcurrentModificationError, + assert_raises(orm_exc.StaleDataError, sess2.query(Base).with_lockmode('read').get, s1.id) if not testing.db.dialect.supports_sane_rowcount: sess2.flush() else: - assert_raises(orm_exc.ConcurrentModificationError, sess2.flush) + assert_raises(orm_exc.StaleDataError, sess2.flush) sess2.refresh(s2) if testing.db.dialect.supports_sane_rowcount: @@ -652,12 +652,14 @@ class VersioningTest(_base.MappedTest): s2.subdata = 'some new subdata' sess.flush() - try: - s1.subdata = 'some new subdata' + s1.subdata = 'some new subdata' + if testing.db.dialect.supports_sane_rowcount: + assert_raises( + orm_exc.StaleDataError, + sess.flush + ) + else: sess.flush() - assert not testing.db.dialect.supports_sane_rowcount - except orm_exc.ConcurrentModificationError, e: - assert True class DistinctPKTest(_base.MappedTest): """test the construction of mapper.primary_key when an inheriting relationship |