Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tests/providers/postgres/hooks/test_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ def test_insert_rows_replace(self):
for row in rows:
self.cur.execute.assert_any_call(sql, row)

@pytest.mark.xfail
@pytest.mark.backend("postgres")
def test_insert_rows_replace_missing_target_field_arg(self):
table = "table"
Expand All @@ -330,9 +329,11 @@ def test_insert_rows_replace_missing_target_field_arg(self):
),
]
fields = ("id", "value")
self.db_hook.insert_rows(table, rows, replace=True, replace_index=fields[0])
with pytest.raises(ValueError) as ctx:
self.db_hook.insert_rows(table, rows, replace=True, replace_index=fields[0])

assert str(ctx.value) == "PostgreSQL ON CONFLICT upsert syntax requires column names"

@pytest.mark.xfail
@pytest.mark.backend("postgres")
def test_insert_rows_replace_missing_replace_index_arg(self):
table = "table"
Expand All @@ -347,7 +348,10 @@ def test_insert_rows_replace_missing_replace_index_arg(self):
),
]
fields = ("id", "value")
self.db_hook.insert_rows(table, rows, fields, replace=True)
with pytest.raises(ValueError) as ctx:
self.db_hook.insert_rows(table, rows, fields, replace=True)

assert str(ctx.value) == "PostgreSQL ON CONFLICT upsert syntax requires an unique index"

@pytest.mark.backend("postgres")
def test_rowcount(self):
Expand Down