-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
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.
There was a problem hiding this 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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank a lot!
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.
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.
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.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Is a whatsnew entry needed for a test fix issue?