Skip to content

TST: Fix sqlite3 transactions test #28450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2019
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
10 changes: 3 additions & 7 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import numpy as np
import pytest

from pandas.compat import PY36

from pandas.core.dtypes.common import is_datetime64_dtype, is_datetime64tz_dtype

import pandas as pd
Expand Down Expand Up @@ -538,11 +536,11 @@ def _to_sql_save_index(self):
assert ix_cols == [["A"]]

def _transaction_test(self):
self.pandasSQL.execute("CREATE TABLE test_trans (A INT, B TEXT)")

ins_sql = "INSERT INTO test_trans (A,B) VALUES (1, 'blah')"
with self.pandasSQL.run_transaction() as trans:
trans.execute("CREATE TABLE test_trans (A INT, B TEXT)")

# Make sure when transaction is rolled back, no rows get inserted
ins_sql = "INSERT INTO test_trans (A,B) VALUES (1, 'blah')"
try:
with self.pandasSQL.run_transaction() as trans:
trans.execute(ins_sql)
Expand Down Expand Up @@ -2213,8 +2211,6 @@ def test_to_sql_save_index(self):
self._to_sql_save_index()

def test_transactions(self):
if PY36:
pytest.skip("not working on python > 3.5")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we say anything about what it would take to fix this? should it be an xfail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I follow, those two lines were removed.

self._transaction_test()

def _get_sqlite_column_type(self, table, column):
Expand Down