-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to pytest-django 4.3.0 #109
Comments
Test failures look like this: https://pytest-django.readthedocs.io/en/latest/changelog.html#v4-3-0-2021-05-15 says:
|
Their issue about this feature: pytest-dev/pytest-django#924 |
For the moment I'm going to pin to 4.2.0 - I'll leave this issue open as an "upgrade to 4.3.0" task. |
I tried fixing it like this but it didn't work: diff --git a/conftest.py b/conftest.py
index 4354a71..aaa24e6 100644
--- a/conftest.py
+++ b/conftest.py
@@ -4,11 +4,13 @@ from django.contrib.auth.models import Permission
from django_sql_dashboard.models import Dashboard
-@pytest.fixture
-def dashboard_db(settings, db):
+@pytest.fixture(autouse=True)
+def django_db_setup(django_db_setup, settings, request, django_db_blocker):
settings.DATABASES["dashboard"]["OPTIONS"] = {
"options": "-c default_transaction_read_only=on -c statement_timeout=100"
}
+ django_db_blocker.unblock()
+ request.addfinalizer(django_db_blocker.restore) |
The tests are currently failing. The difference looks to be pytest-django 4.3.0.
The last tests that passed show this:
The tests that now fail show:
The text was updated successfully, but these errors were encountered: