Make coverage conditional on run.py flag
Coverage can now be enabled by running './run.py --coverage'.
--- a/tests/run.py Mon Sep 14 18:44:46 2009 +0200
+++ b/tests/run.py Mon Sep 14 18:52:57 2009 +0200
@@ -94,9 +94,23 @@
callback.registerCore(core.Core())
callback.getCore().registerModuleCallbacks()
- from nose.plugins import cover
- plugin = cover.Coverage()
- nose.main(plugins=[AppEngineDatastoreClearPlugin(), plugin])
+ plugins = [AppEngineDatastoreClearPlugin()]
+
+ if '--coverage' in sys.argv:
+ from nose.plugins import cover
+ plugin = cover.Coverage()
+ plugins.append(plugin)
+
+ args = ['--with-coverage',
+ '--cover-package=soc',
+ '--cover-erase',
+ '--cover-html',
+ '--cover-html-dir=coverageResults']
+
+ sys.argv.remove('--coverage')
+ sys.argv += args
+
+ nose.main(plugins=plugins)
if __name__ == '__main__':
--- a/tests/setup.cfg Mon Sep 14 18:44:46 2009 +0200
+++ b/tests/setup.cfg Mon Sep 14 18:52:57 2009 +0200
@@ -1,8 +1,3 @@
[nosetests]
exclude=pymox
-with-coverage=1
-cover-package=soc
-cover-erase=1
-cover-html=1
-cover-html-dir=coverageResults
#debug=nose.plugins.cover