Skip to content

Commit a2846e4

Browse files
committed
add an xfail test for what we can't fix
1 parent d3a7090 commit a2846e4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from postgres.cursors import TooFew, TooMany, SimpleDictCursor
99
from postgres.orm import ReadOnly, Model
1010
from psycopg2 import InterfaceError, ProgrammingError
11-
from pytest import raises
11+
from pytest import mark, raises
1212

1313

1414
DATABASE_URL = os.environ['DATABASE_URL']
@@ -339,6 +339,14 @@ def test_add_column_doesnt_break_anything(self):
339339
one = self.db.one("SELECT foo.*::foo FROM foo WHERE bar='baz'")
340340
assert one.boo is None
341341

342+
@mark.xfail
343+
def test_add_and_drop_columns(self):
344+
self.db.run("ALTER TABLE foo ADD COLUMN biz int NOT NULL DEFAULT 0")
345+
self.db.run("ALTER TABLE foo DROP COLUMN bar")
346+
one = self.db.one("SELECT foo.*::foo FROM foo LIMIT 1")
347+
assert one.biz == 0
348+
assert not hasattr(one, 'bar')
349+
342350

343351
# cursor_factory
344352
# ==============

0 commit comments

Comments
 (0)