summaryrefslogtreecommitdiff
path: root/test/test_testplugin.py
diff options
context:
space:
mode:
authorDavid Stanek <dstanek@dstanek.com>2010-05-21 23:26:51 -0400
committerDavid Stanek <dstanek@dstanek.com>2010-05-21 23:26:51 -0400
commit5b078202a2a80dfb40084a41d97ccd8859750fd1 (patch)
tree330be09dfe7ff46449b9a38879523e07a1fddb02 /test/test_testplugin.py
parent51e42b3e3c0f92568a8e058189585c2baf3ca4ff (diff)
parent7ccdc87d3e4ad3a7933c3fc34e37213f36f3229a (diff)
downloadpython-coveragepy-git-5b078202a2a80dfb40084a41d97ccd8859750fd1.tar.gz
merged in latest changes from Ned's repo
Diffstat (limited to 'test/test_testplugin.py')
-rw-r--r--test/test_testplugin.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/test_testplugin.py b/test/test_testplugin.py
new file mode 100644
index 00000000..c216ead6
--- /dev/null
+++ b/test/test_testplugin.py
@@ -0,0 +1,36 @@
+import py
+import unittest
+from nose.plugins import PluginTester
+from coverage.noseplugin import Coverage
+
+class TestCoverage(PluginTester, unittest.TestCase):
+ activate = '--with-coverage_new' # enables the plugin
+ plugins = [Coverage()]
+ args = ['--cover-action=report']
+
+ @py.test.mark.skipif(True) # "requires nose test runner"
+ def test_output(self):
+ assert "Processing Coverage..." in self.output, (
+ "got: %s" % self.output)
+ def makeSuite(self):
+ class TC(unittest.TestCase):
+ def runTest(self):
+ raise ValueError("Coverage down")
+ return unittest.TestSuite([TC()])
+
+pytest_plugins = ['pytester']
+def test_functional(testdir):
+ testdir.makepyfile("""
+ def f():
+ x = 42
+ def test_whatever():
+ pass
+ """)
+ result = testdir.runpytest("--cover-action=annotate")
+ assert result.ret == 0
+ assert result.stdout.fnmatch_lines([
+ '*Processing Coverage*'
+ ])
+ coveragefile = testdir.tmpdir.join(".coverage")
+ assert coveragefile.check()
+ # XXX try loading it?