#33633: test_reset_sequences/test_execute_tree/test_execute_recursive fail for
backends not supporting transactions
-----------------------------------+--------------------------------------
     Reporter:  Xiang Zhang        |                    Owner:  nobody
         Type:  Uncategorized      |                   Status:  new
    Component:  Testing framework  |                  Version:  4.0
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------
Description changed by Xiang Zhang:

Old description:

> {{{
> FAIL: test_reset_sequences (test_utils.test_testcase.TestTestCase)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/Users/zhangyangyu/repos/django-
> tidb/django_tests_dir/django/tests/test_utils/test_testcase.py", line 47,
> in test_reset_sequences
>     old_reset_sequences = self.reset_sequences
>   File
> "/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py",
> line 126, in __exit__
>     next(self.gen)
>   File "/Users/zhangyangyu/repos/django-
> tidb/django_tests_dir/django/django/test/testcases.py", line 807, in
> _assert_raises_or_warns_cm
>     yield cm
> AssertionError: TypeError not raised
> }}}
>
> `test_reset_sequences` fails with above error if testing against backends
> not supporting transactions, like MySQL MyIASM engine.

New description:

 {{{
 FAIL: test_reset_sequences (test_utils.test_testcase.TestTestCase)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/zhangyangyu/repos/django-
 tidb/django_tests_dir/django/tests/test_utils/test_testcase.py", line 47,
 in test_reset_sequences
     old_reset_sequences = self.reset_sequences
   File
 
"/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py",
 line 126, in __exit__
     next(self.gen)
   File "/Users/zhangyangyu/repos/django-
 tidb/django_tests_dir/django/django/test/testcases.py", line 807, in
 _assert_raises_or_warns_cm
     yield cm
 AssertionError: TypeError not raised
 }}}

 {{{
 FAIL: test_execute_tree (test_utils.tests.CaptureOnCommitCallbacksTests)
 A visualisation of the callback tree tested. Each node is expected to
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/zhangyangyu/repos/django-
 tidb/django_tests_dir/django/tests/test_utils/tests.py", line 1657, in
 test_execute_tree
     self.assertEqual(callbacks, [branch_1, branch_2, leaf_3, leaf_1,
 leaf_2])
 AssertionError: Lists differ: [] != [<function
 CaptureOnCommitCallbacksTests.t[412 chars]ee0>]

 Second list contains 5 additional elements.
 First extra element 0:
 <function
 CaptureOnCommitCallbacksTests.test_execute_tree.<locals>.branch_1 at
 0x107c52430>

 - []
 + [<function
 CaptureOnCommitCallbacksTests.test_execute_tree.<locals>.branch_1 at
 0x107c52430>,
 +  <function
 CaptureOnCommitCallbacksTests.test_execute_tree.<locals>.branch_2 at
 0x107c52040>,
 +  <function
 CaptureOnCommitCallbacksTests.test_execute_tree.<locals>.leaf_3 at
 0x107c52dc0>,
 +  <function
 CaptureOnCommitCallbacksTests.test_execute_tree.<locals>.leaf_1 at
 0x107e17310>,
 +  <function
 CaptureOnCommitCallbacksTests.test_execute_tree.<locals>.leaf_2 at
 0x107c52ee0>]
 }}}

 {{{
 FAIL: test_execute_recursive
 (test_utils.tests.CaptureOnCommitCallbacksTests)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/zhangyangyu/repos/django-
 tidb/django_tests_dir/django/tests/test_utils/tests.py", line 1604, in
 test_execute_recursive
     self.assertEqual(len(callbacks), 2)
 AssertionError: 0 != 2
 }}}


 `test_reset_sequences`/`test_execute_tree`/`test_execute_recursive` fail
 with above error if testing against backends not supporting transactions,
 like MySQL MyIASM engine.

--

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070180138bc802-c345f50b-c396-46e4-9f21-1626288da28c-000000%40eu-central-1.amazonses.com.

Reply via email to