summaryrefslogtreecommitdiff
path: root/unit_tests
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2013-01-21 09:04:44 -0500
committerJohn Szakmeister <john@szakmeister.net>2013-01-21 09:04:44 -0500
commitd377dad7b2e067a48d1a479dd6cd68500a3fd310 (patch)
tree5a71046e4630c6eadcee4cf58dfa5bc831b4ee3f /unit_tests
parentf5790a16d292271155d6f8552e3b52b21487ce2b (diff)
parentdb0747afb5132c33e9ed3f90e9c205a8cbbaa663 (diff)
downloadnose-d377dad7b2e067a48d1a479dd6cd68500a3fd310.tar.gz
Merge pull request #520 from Bahus/patch-1
Bugfix for the issue #109: Fails to properly parse NOSE_COVER_PACKAGE environment variable. Also added a test. Note: I did not merge the other patch on this branch (ffc3701) because I'm not sure it's the right fix.
Diffstat (limited to 'unit_tests')
-rw-r--r--unit_tests/test_cover_plugin.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/unit_tests/test_cover_plugin.py b/unit_tests/test_cover_plugin.py
new file mode 100644
index 0000000..62052f2
--- /dev/null
+++ b/unit_tests/test_cover_plugin.py
@@ -0,0 +1,25 @@
+import sys
+from optparse import OptionParser
+from nose.config import Config
+from nose.plugins.cover import Coverage
+from nose.tools import eq_
+import unittest
+
+class TestCoveragePlugin(object):
+
+ def test_cover_packages_option(self):
+ parser = OptionParser()
+ c = Coverage()
+ c.addOptions(parser)
+ options, args = parser.parse_args(['test_can_be_disabled',
+ '--cover-package=pkg1,pkg2,pkg3'])
+ c.configure(options, Config())
+ eq_(['pkg1', 'pkg2', 'pkg3'], c.coverPackages)
+
+ env = {'NOSE_COVER_PACKAGE': 'pkg1,pkg2,pkg3'}
+ c = Coverage()
+ parser = OptionParser()
+ c.addOptions(parser, env)
+ options, args = parser.parse_args(['test_can_be_disabled'])
+ c.configure(options, Config())
+ eq_(['pkg1', 'pkg2', 'pkg3'], c.coverPackages)