-
Notifications
You must be signed in to change notification settings - Fork 346
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
database creation not happening for LiveServerTestCase? #79
Comments
Thanks for the report! I have been able to reproduce the issue: I have been able to run the tests successfully with "python manage.py test", but not with py.test. It seems like the database is not properly shared between the live server thread and the main thread. A related issue is the lack of logging - I had to configure a debugging logger to get any information about what was going on. I will investigate if it is possible to set some sane defaults on the logger when running in tests, to have the exception information properly shown. |
Nice one Andreas! I'll be at the pycon sprints tomorrow, are any of your contributors here? re: the logging, i think that's django's fault. here's how i hack the logging settings to get stuff onto stderr... http://chimera.labs.oreilly.com/books/1234000000754/ch14.html#aside_logging_to_stderr |
I am unfortunately not at pycon :( It looks like @flub and Holger are organizing a pytest sprint: I am pelme on #pylib on Freenode and will try to respond/merge things as soon as I can too. |
Hi, I haven't looked at this issue yet but do come along and I'll gladly help. The sprint certainly doesn't need to be restricted to py.test core |
After spending some more time on this, I found the issue to a problem of how pytest handles the combination of setUpClass and autouse fixtures (which is used to setup the Django test database in pytest-django): https://bitbucket.org/pytest-dev/pytest/issue/517/setup_-executed-before-all-fixtures When that issue gets solved, this should hopefully work. :-) |
In https://bitbucket.org/pytest-dev/pytest/issue/517/setup_-executed-before-all-fixtures#comment-14576060 it is mentioned that 8a9aacb fixes it. @hjwp |
Am in Holger's py.test tutorial at the PyCon. Thought I'd try to get py.test working on a small test repo, and it looks like
django.test.TestCase
tests are working fine, including those that need the test database, but classes fromdjango.test.LiveServerTestCase
seem not to be seeing the test database...Maybe I'm just confused?
here's the test repo: https://github.com/hjwp/book-example/tree/chapter_07
you'll need a virtualenv built with python3, django 1.7 beta, and selenium:
and then
The text was updated successfully, but these errors were encountered: