Re: [Django] #33633: Some test_utils tests fail on databases that don't support transactions. (was: test_reset_sequences/test_execute_tree/test_execute_recursive fail for backends not supporting transactions)

2 views
Skip to first unread message

Django

unread,
Apr 11, 2022, 12:30:52 AM4/11/22
to django-...@googlegroups.com
#33633: Some test_utils tests fail on databases that don't support transactions.
--------------------------------------+------------------------------------
Reporter: Xiang Zhang | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* type: Uncategorized => Cleanup/optimization
* component: Testing framework => Core (Other)
* stage: Unreviewed => Accepted


Comment:

Thanks for the report. I was able to reproduce even more failures:
{{{
ERROR: test_failure_in_setUpTestData_should_rollback_transaction
(test_utils.tests.TestBadSetUpTestData)
FAIL: test_reset_sequences (test_utils.test_testcase.TestTestCase)
FAIL: test_class_attribute_identity
(test_utils.test_testcase.TestDataTests)
FAIL: test_execute (test_utils.tests.CaptureOnCommitCallbacksTests)
FAIL: test_execute_recursive
(test_utils.tests.CaptureOnCommitCallbacksTests)
FAIL: test_execute_tree (test_utils.tests.CaptureOnCommitCallbacksTests)
FAIL: test_no_arguments (test_utils.tests.CaptureOnCommitCallbacksTests)
FAIL: test_pre_callback (test_utils.tests.CaptureOnCommitCallbacksTests)
FAIL: test_using (test_utils.tests.CaptureOnCommitCallbacksTests)
}}}

`CaptureOnCommitCallbacksTests` should be skipped on databases that don't
support transactions, i.e. decorated with
`@skipUnlessDBFeature("supports_transactions")`. I didn't check other
failures. Would you like to prepare a patch?

--
Ticket URL: <https://code.djangoproject.com/ticket/33633#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages