Ticket #17251: 17251.diff

File 17251.diff, 1.1 KB (added by Anssi Kääriäinen, 13 years ago)
  • tests/modeltests/select_for_update/tests.py

    diff --git a/tests/modeltests/select_for_update/tests.py b/tests/modeltests/select_for_update/tests.py
    index efaffb9..e480dfb 100644
    a b class SelectForUpdateTests(TransactionTestCase):  
    173173            status.append(e)
    174174        except Exception, e:
    175175            raise
     176        finally:
     177            # Different thread, different connection. This connection
     178            # was used just in this thread, so close it immediately.
     179            connection.close()
    176180
    177181    @requires_threading
    178182    @skipUnlessDBFeature('has_select_for_update')
    class SelectForUpdateTests(TransactionTestCase):  
    244248                )
    245249            except DatabaseError, e:
    246250                status.append(e)
     251            finally:
     252                # Different thread, different connection. This connection
     253                # was used just in this thread, so close it immediately.
     254                connection.close()
     255
    247256        status = []
    248257        thread = threading.Thread(target=raw, kwargs={'status': status})
    249258        thread.start()
Back to Top