-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Running Pytest From Repo Master #410
Comments
Probably problem from #338 |
If you need any more information - let me know! |
@Mogost Checking your suggestion in #338 (review) |
@TE-Good can you please tell if you use pytest-django in your project? |
@TamoshaytisV Yeah, pytest-django version 3.3.3 |
@Mogost i created PR which skips pytest hooks but after some investigation, I think the issue is not with constance pytest plugin. From what I see in the issue description's traceback + source code, that is the normal process of loading django-constance module
also in the django sources I see def _setup(self, name=None):
"""
Load the settings module pointed to by the environment variable. This
is used the first time settings are needed, if the user hasn't
configured settings manually.
"""
settings_module = os.environ.get(ENVIRONMENT_VARIABLE)
if not settings_module:
desc = ("setting %s" % name) if name else "settings"
raise ImproperlyConfigured(
"Requested %s, but settings are not configured. "
"You must either define the environment variable %s "
"or call settings.configure() before accessing settings."
% (desc, ENVIRONMENT_VARIABLE))
self._wrapped = Settings(settings_module) Which raises error that @TE-Good reported. That exception fires when there's no @TE-Good can you please tell how you run pytest and which params you pass to it? Can you please try to set |
I would invite @blueyed here. Could you help us with this? |
I reinstalled the package from master, through poetry, ran
I set the
|
@TE-Good Okay, good news :) If you are using pytest-django, you can just add |
Thanks @TamoshaytisV! I appreciate yours, and everyone else's time on this. What is a bit curious to me is if I install django-constance 2.6.0, it all runs well with no errors. I have a
I'll try and do a little digging - I'm not very versed in all this though! |
The PR #412 seems to have fixed it! |
Describe the problem
I installed the latest django-constance from this git repo, through the poetry command:
poetry add --git=https://github.com/jazzband/django-constance.git -v --allow-prereleases django-constance
.My issue is, when running pytest in an activated conda environment I get a the following error;
To compare, I installed the released 2.6 version, and with our settings configuration, we had no errors. I added this through the command:
poetry add django-constance
.When running
runserver
on both installs, there are no errors. It seems to be isolated to pytest.Steps to reproduce
See in above description.
System configuration
The text was updated successfully, but these errors were encountered: