diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-12-02 18:54:40 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-12-02 18:58:47 -0500 |
commit | eacb31a89fe883edd0ada7f2724239c1f8c5b685 (patch) | |
tree | c3ddcc147e0cad6ec5d244c2b691ce182b3ee31f /test/ext/declarative/test_basic.py | |
parent | c8dea359db9bea58dc64880d306dbee2a26df247 (diff) | |
download | sqlalchemy-eacb31a89fe883edd0ada7f2724239c1f8c5b685.tar.gz |
"left" -> "accidentally placed at"
since "left" is kind of ambiguous, use more explicit terminology
here.
Also update the test to use a positive assertion that the
warning is emitted; quote the attribute name.
Change-Id: Ic2284c200a26b32b2da063cfaf6d59547309d587
References: https://github.com/zzzeek/sqlalchemy/pull/488
Diffstat (limited to 'test/ext/declarative/test_basic.py')
-rw-r--r-- | test/ext/declarative/test_basic.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/test/ext/declarative/test_basic.py b/test/ext/declarative/test_basic.py index 611598413..f45421ad9 100644 --- a/test/ext/declarative/test_basic.py +++ b/test/ext/declarative/test_basic.py @@ -1170,23 +1170,17 @@ class DeclarativeTest(DeclarativeTestBase): eq_(Foo.__mapper__.CHECK, True) - @testing.emits_warning('Ignoring declarative-like tuple value of ' - 'attribute id') def test_oops(self): - def define(): + with testing.expect_warnings( + "Ignoring declarative-like tuple value of " + "attribute 'name'"): class User(Base, fixtures.ComparableEntity): __tablename__ = 'users' - id = Column('id', Integer, primary_key=True), - name = Column('name', String(50)) - - assert False - - assert_raises_message(sa.exc.ArgumentError, - 'Mapper Mapper|User|users could not ' - 'assemble any primary key', define) + id = Column('id', Integer, primary_key=True) + name = Column('name', String(50)), def test_table_args_no_dict(self): |