Both of the above changes are available from:
https://github.com/akaariai/django/compare/test_auto_settings
The first item raises a question: is there some use case where one wants
to run tests against *different* django version? To me it seems one
wouldn't want to do this, the tests are tied to specific django version.
I can't see any drawback by doing the second item.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* stage: Unreviewed => Accepted
Comment:
I fully agree with 1. and 2. -- I am against supporting other Django
versions.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:1>
* stage: Accepted => Ready for checkin
Comment:
LGTM, with the caveat that the long term goal is to get rid of
runtests.py, not extend it...
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:2>
* needs_docs: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
Not RFC yet in fact :)
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:3>
* cc: timograham@… (added)
* needs_docs: 1 => 0
Comment:
[https://github.com/django/django/pull/1352 PR] with update docs.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:4>
* stage: Accepted => Ready for checkin
Comment:
Looks good to me.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:5>
Comment (by timo):
I'm unsure why `import django` is needed? Also the comment in the
docstring of `upath` references a "try-except of import django" which
isn't present.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:6>
Comment (by loic84):
I spotted the `import django` and I assumed it was meant as an `assert`.
In light of the docstring, maybe the idea was to provide a helpful error
message?
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"b2314d9e1e08749f2c05151f9cd44520d2b3a03a"]:
{{{
#!CommitTicketReference repository=""
revision="b2314d9e1e08749f2c05151f9cd44520d2b3a03a"
Fixed #19941 -- Modified runtests.py to make running the tests easier.
1. Automatically use tests/../django as the Django version.
2. If settings aren't provided through --settings or
DJANGO_SETTINGS_MODULE)
then use test_sqlite.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:8>
* status: closed => new
* resolution: fixed =>
Comment:
Reopening the sys.path.insert call makes the test setup differ from
standard installation procedures. We've for a long time tried hard to move
away from modifying the sys.path.
As a background, by mangling the sys.path we risk missing import errors
that happen when Django is installed with tools like pip. Instead we
should promote the use of ``pip install -e path/to/django`` when
developing Django.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:9>
Comment (by apollo13):
After discussing this a bit more with jezdez in IRC we came to the
following conclusion:
* `pip install -e .` isn't perfect (in the sense that it doesn't mimic a
sdist install by 100%) but still better than `sys.path` hacks.
* drop `sys.path` hacks again.
* Update the documentation to note `pip install -e` and `PYTHONPATH=..`
alternatives.
* Output something like `print("Testing against Django installed in '%s'"
% django.__file__)` to the console, to allow easier debugging.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:10>
* cc: apollo13 (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:11>
* has_patch: 1 => 0
* stage: Ready for checkin => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:12>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/1793 Pull request] with changes
proposed above.
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:13>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"c573d6de173c0e6743473081cde786e749641a48"]:
{{{
#!CommitTicketReference repository=""
revision="c573d6de173c0e6743473081cde786e749641a48"
Fixed #19941 -- Removed sys.path hack when running the test suite.
Thanks jezdez for the suggestion.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/19941#comment:14>