#22420: Postgresql connections not being dropped between tests?
-----------------------------------+--------------------------------------
     Reporter:  Matthew Fisher     |                    Owner:  nobody
         Type:  Bug                |                   Status:  closed
    Component:  Testing framework  |                  Version:  3.0
     Severity:  Normal             |               Resolution:  needsinfo
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------

Comment (by David Greaves):

 In case this is useful to others I'll add this here:

 I'm running my tests and using some asyncio code and the pytest_django
 plugin

 I'm using a ThreadExecutor to run the django via the 'a' methods or
 sync_to_async
 I've used a hacked version of django_db_setup to make this run.

 All db operations are working but I get this problem.

 My suspicion is that the initial django setup is occuring in the
 MainThread as there is a connection to the test db there.

 Adding in a ```conn.close()``` loop into the  ```django_db_setup()```
 finalizer resolved the issue for me.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22420#comment:29>
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/0107018698dbe1f6-fe0442c4-8c71-4d68-bbde-853f4f12f4a0-000000%40eu-central-1.amazonses.com.

Reply via email to