Changes between Initial Version and Version 1 of Ticket #33906


Ignore:
Timestamp:
Aug 8, 2022, 3:46:51 AM (2 years ago)
Author:
an-mile
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33906 – Description

    initial v1  
    11Hello! I'm filing my first Django bug and hopefully it is meaningful:
    22
    3 When a db integrity error occurs in some test, the exception is captured by the test suite and following code in the test is executed. This is inconsistent with any other exception that might arise from test code execution.
     3When a db integrity error occurs in some test, the exception is captured by the test suite and following code in the test is executed. This seems inconsistent with any other exception that might arise from test code execution.
    44It might be similar to the closed ticket https://code.djangoproject.com/ticket/14223
    55
     
    4040        # NammeErrorWouldRaiseHere
    4141        Article.objects.bulk_create(objs)  # DB Integrity Error captured...
    42        print('Hello Dear Django Coders!')
     42        print('Hello Dear Django Coders!')
    4343        self.assertEqual(1, 2)
    4444}}}
     
    6161AssertionError: 1 != 2
    6262}}}
    63 But when uncommenting the "NammeErrorWouldRaiseHere" ,  "Hello Dear Django Coders!'"  is not printed, nor the last "AssertionError" is not executed. This seams confusing and inconsistent behavior.
     63But when uncommenting the "NammeErrorWouldRaiseHere" ,  "Hello Dear Django Coders!'"  is not printed, nor is the last "AssertionError" executed. This seems confusing and inconsistent behavior.
    6464
    6565It appears on SQLite as well as with PsycoPg / PG. Furthermore, the exception can not be captured within the Code with a regular try-except. Following modification of the test will not print "Hello" :
Back to Top