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.
This commit is contained in:
Calen Pennington
2013-04-17 09:58:52 -04:00
parent 24189378d6
commit f252c62f31
4 changed files with 6 additions and 7 deletions

View File

@@ -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')

View File

@@ -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

View File

@@ -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

4
setup.cfg Normal file
View File

@@ -0,0 +1,4 @@
[nosetests]
logging-clear-handlers=1
with-xunit=1
rednose=1