Hi Chris,

On May 18, 2013, at 9:42 AM, Chris Wilson <[email protected]> wrote:
> Another odd behaviour of the new test runner. This runs the tests, but fails 
> to add the test app to INSTALLED_APPS, so they all fail because their tables 
> are not created:
> 
>    PYTHONPATH=.. python -Wall runtests.py --selenium --verbosity 2 \
>    --settings=tests.travis_configs.test_postgres_nogis \
>    tests.transactions.tests.AtomicInsideTransactionTests
> 
> Changing the spec to remove the initial "tests." results in the app being 
> loaded and the tests run:
> 
>    PYTHONPATH=.. python -Wall runtests.py --selenium --verbosity 2 \
>    --settings=tests.travis_configs.test_postgres_nogis \
>    transactions.tests.AtomicInsideTransactionTests
> 
> Is this expected behaviour? It's rather counter-intuitive to me.

The initial "tests." prefix shouldn't be used, and wasn't intended to be 
supported. There is no __init__.py in the tests/ directory, and when running 
runtests.py the tests/ directory itself is placed on sys.path, so every module 
in there is a top-level module when running tests. I'm actually surprised 
unittest itself even runs the tests when specified that way, given the lack of 
__init__.py.

That said, if this turns out to to be something that trips a lot of people up, 
it would be trivial to add a special-case in runtests.py to look for and remove 
the initial "tests." in provided test labels.

Carl

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to