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

Conversation

quintusdias
Copy link
Contributor

@quintusdias quintusdias commented Sep 14, 2019

The sqlite connection is already in transaction when the test starts, so
when the test intentionally raises an exception, the entire transaction,
including the table creation, gets rolled back, so there is no table
to query. Wrapping the table CREATE statement in its own transaction
avoids the issue.

Is a whatsnew entry needed for a test fix issue?

The sqlite connection is already in transaction when the test starts, so
when the test intentionally raises an exception, the entire transaction,
including the table creation, gets rolled back, so there is no table
to query.  Wrapping the table CREATE statement in its own transaction
avoids the issue.
@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Sep 14, 2019
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM. A whatsnew note isn't necessary.

@@ -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.

Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

Nice!

@jorisvandenbossche jorisvandenbossche added this to the 1.0 milestone Sep 15, 2019
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Thank a lot!

@jorisvandenbossche jorisvandenbossche merged commit 3f0e816 into pandas-dev:master Sep 15, 2019
@quintusdias quintusdias deleted the issue14719 branch September 15, 2019 15:23
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
The sqlite connection is already in transaction when the test starts, so
when the test intentionally raises an exception, the entire transaction,
including the table creation, gets rolled back, so there is no table
to query.  Wrapping the table CREATE statement in its own transaction
avoids the issue.
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
The sqlite connection is already in transaction when the test starts, so
when the test intentionally raises an exception, the entire transaction,
including the table creation, gets rolled back, so there is no table
to query.  Wrapping the table CREATE statement in its own transaction
avoids the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: test_transactions for sqlite fallback fails on python 3.6
5 participants