Skip to content
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 on Docker has DEBUG=False, even with intervention #2599

Closed
Andrew-Chen-Wang opened this issue May 16, 2020 · 2 comments
Closed

Comments

@Andrew-Chen-Wang
Copy link
Contributor

What happened?

When testing with the command docker-compose -f local.yml run --rm django pytest, my program asserted that DEBUG was False. From config.settings.base, it makes sense why.

However, if you add DEBUG=True above and below the import in config.settings.test, the DEBUG is still False.

What should've happened instead?

settings.DEBUG should've been False.

Steps to reproduce

Create a view or something that raises an error if debug is False. In config.settings.test, add DEBUG=True above and below the import statement, but the bottom is most important. Finally, check DEBUG with a test.

@browniebroke
Copy link
Member

This is set by pytest-django here and it's apparently the same thing in Django.

There was an issue opened a while ago to change that, a first PR which was merged, then revered here. There is now an open PR for it.

I'll close this, feel free to get in touch with pytest-django to get the above PR merged.

@Andrew-Chen-Wang
Copy link
Contributor Author

Can’t believe it was a pytest django problem. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants