We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 787bbec commit db37f64Copy full SHA for db37f64
pytest_django/fixtures.py
@@ -110,7 +110,14 @@ def django_db_setup(
110
111
def teardown_database():
112
with django_db_blocker.unblock():
113
- teardown_databases(db_cfg, verbosity=request.config.option.verbose)
+ try:
114
+ teardown_databases(db_cfg, verbosity=request.config.option.verbose)
115
+ except Exception as exc:
116
+ request.node.warn(
117
+ pytest.PytestWarning(
118
+ "Error when trying to teardown test databases: %r" % exc
119
+ )
120
121
122
if not django_db_keepdb:
123
request.addfinalizer(teardown_database)
0 commit comments