note on runtests.py #655

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@evildmp
Contributor
evildmp commented Jan 17, 2013

The tutorial didn't mention how to run tests other than in a project, so I added a couple of short paragraphs.

I realised that https://docs.djangoproject.com/en/1.4/topics/testing/ doesn't either, and I think it should.

https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#quickstart does discuss it.

Owner

I'm not sure copy-pasting an unspecified runtests.py script from one project to the other is the best advice here.

It seems to me the easiest is to ship test settings and use django-admin.py test --settings=test_settings mypluggableapp works.

Example: https://github.com/aaugustin/django-resto/blob/master/Makefile#L2-3

Contributor
evildmp commented Jan 17, 2013

Yes. But actually it seems like a lot more to explain than I first thought:

  • manage.py puts your project on the pythonpath, which is what makes any of it usable in the first place
  • the polls application is only available because of manage.py
  • django-admin.py test --settings=test_settings will only work if test_settings is a module on the python path

So it's not actually possible to use django-admin.py test without also explaining how to put something on the pythonpath.

It's looking more complex than is really appropriate for this tutorial, I think.

Owner

Agreed, I don't think this note is appropriate for the tutorial in its current state. If you'd like to flesh out the idea a bit more, we can consider adding it.

@timgraham timgraham closed this Feb 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment