Permalink
Browse files

Fixed run_tests.py to use correct DJANGO_SETTINGS_MODULE and argv

  • Loading branch information...
1 parent 940e2b0 commit 17087f5bd5ad740c1d689aa2065cecab49d8cb53 @xaralis xaralis committed Feb 9, 2012
Showing with 9 additions and 19 deletions.
  1. +3 −11 INSTALL
  2. +0 −4 test_ella/__init__.py
  3. +6 −4 test_ella/run_tests.py
View
@@ -17,18 +17,10 @@ For development, we recommend use virtualenv (and wrapper) like this:
$ git clone git://github.com/ella/ella.git
$ cd ella
$ mkvirtualenv ella
- $ pip install -r requirements/base.txt -r requirements/with-markup.txt \
- -r requirements/with-comments.txt -r requirements/testing.txt
-
+ $ pip install -r dev_requirements.txt
Then you can test this installation:
- $ ./tests/unit_project/run_tests.py
-
-
-And start playing with example project:
-
- $ cd tests/example_project
- $ ./manage.py syncdb
- $ ./manage.py runserver
+ $ cd test_ella
+ $ ./test_ella/run_tests.py
@@ -5,13 +5,9 @@
If You're looking for example project, take a look into example_project directory.
"""
-import os
-
test_runner = None
old_config = None
-os.environ['DJANGO_SETTINGS_MODULE'] = 'test_ella.settings'
-
def setup():
global test_runner
global old_config
@@ -6,17 +6,19 @@
'''
import sys
+import os
+
from os.path import abspath, dirname
import nose
def run_all(argv=None):
- if argv is None:
+ os.environ['DJANGO_SETTINGS_MODULE'] = 'test_ella.settings'
+
+ if len(argv) == 1: # only the command itself is in argv
@HonzaKral
HonzaKral Feb 10, 2012 Member

This breaks running the test suite as python setup.py test which is the standard for python packages.

Also nose has no --with-django option, that was for django-sane-testing which ella no longer uses.

@xaralis
xaralis Feb 10, 2012 Member

I'll try to fix it. There must be something wrong since without it, the tests won't run as expected without setting the DJANGO_SETTINGS_MODULE by hand. I'll make this work both ways.

@HonzaKral
HonzaKral via email Feb 10, 2012 Member
argv = [
- 'nosetests',
+ '--with-django',
'--with-coverage', '--cover-package=ella', '--cover-erase',
- '--nocapture', '--nologcapture',
- '--verbose',
]
nose.run_exit(

0 comments on commit 17087f5

Please sign in to comment.