(conn, request, test_frame1)
| 1630 | |
| 1631 | @pytest.mark.parametrize("conn", all_connectable) |
| 1632 | def test_api_to_sql_fail(conn, request, test_frame1): |
| 1633 | conn = request.getfixturevalue(conn) |
| 1634 | if sql.has_table("test_frame2", conn): |
| 1635 | with sql.SQLDatabase(conn, need_transaction=True) as pandasSQL: |
| 1636 | pandasSQL.drop_table("test_frame2") |
| 1637 | |
| 1638 | sql.to_sql(test_frame1, "test_frame2", conn, if_exists="fail") |
| 1639 | assert sql.has_table("test_frame2", conn) |
| 1640 | |
| 1641 | msg = "Table 'test_frame2' already exists" |
| 1642 | with pytest.raises(ValueError, match=msg): |
| 1643 | sql.to_sql(test_frame1, "test_frame2", conn, if_exists="fail") |
| 1644 | |
| 1645 | |
| 1646 | @pytest.mark.parametrize("conn", all_connectable) |
nothing calls this directly
no test coverage detected