`isinstance(django_settings, type)` triggers ImproperlyConfigured, although settings are not really accessed
— at Version 2
Checking if django.conf.settings is a class should not trigger an exception, but the following code triggers ImproperlyConfigured already:
from django.conf import settings as django_settings
isinstance(django_settings, type)
(via https://github.com/pytest-dev/pytest/issues/4266)
Change History
(2)
| Resolution: |
→ invalid
|
| Status: |
new → closed
|
| Component: |
Uncategorized → Core (Other)
|
| Description: |
modified (diff)
|
| Type: |
Uncategorized → Bug
|
As mentioned on the linked PR this has little to do with the
isinstancecheck; accessingdjango.conf.settingsattributes (in this case__class__throughisinstance) is prohibited until settings are configured.