From f252c62f31ff20a5821a7a7cffeb8a81e42f98ce Mon Sep 17 00:00:00 2001 From: Calen Pennington Date: Wed, 17 Apr 2013 09:58:52 -0400 Subject: [PATCH] Enable test colors in nosetests Use setup.cfg to set up default settings when running nose tests. Enable the rednose library to color test output. --- cms/envs/test.py | 1 - lms/envs/test.py | 6 +----- rakefile | 2 +- setup.cfg | 4 ++++ 4 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 setup.cfg diff --git a/cms/envs/test.py b/cms/envs/test.py index 99869bc869..be1d872e64 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -13,7 +13,6 @@ from path import path # Nose Test Runner INSTALLED_APPS += ('django_nose',) -NOSE_ARGS = ['--with-xunit'] TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' TEST_ROOT = path('test_root') diff --git a/lms/envs/test.py b/lms/envs/test.py index 5eb96c8df0..5c1770caaa 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -27,10 +27,6 @@ SOUTH_TESTS_MIGRATE = False # To disable migrations and use syncdb instead # Nose Test Runner INSTALLED_APPS += ('django_nose',) -NOSE_ARGS = [ - '--with-xunit', - # '-v', '--pdb', # When really stuck, uncomment to start debugger on error -] TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' # Local Directories @@ -122,7 +118,7 @@ CACHES = { 'LOCATION': '/var/tmp/mongo_metadata_inheritance', 'TIMEOUT': 300, 'KEY_FUNCTION': 'util.memcache.safe_key', - } + } } # Dummy secret key for dev diff --git a/rakefile b/rakefile index 80669afed6..d67aea8f36 100644 --- a/rakefile +++ b/rakefile @@ -269,7 +269,7 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib| desc "Run tests for common lib #{lib}" task task_name => report_dir do ENV['NOSE_XUNIT_FILE'] = File.join(report_dir, "nosetests.xml") - cmd = "nosetests #{lib} --logging-clear-handlers --with-xunit" + cmd = "nosetests #{lib}" sh(run_under_coverage(cmd, lib)) do |ok, res| $failed_tests += 1 unless ok end diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000000..e46f3858f4 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,4 @@ +[nosetests] +logging-clear-handlers=1 +with-xunit=1 +rednose=1 \ No newline at end of file