[py-svn] pytest-coverage commit a0eb9054e60a: fixing tests, updating README and pytest_coverage module doc string

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat May 22 17:56:23 CEST 2010


# HG changeset patch -- Bitbucket.org
# Project pytest-coverage
# URL http://bitbucket.org/prologic/pytest-coverage/overview
# User holger krekel <holger at merlinux.eu>
# Date 1274543343 -7200
# Node ID a0eb9054e60abded2f86bf051f9d819b03449a7e
# Parent  49dc7ecad578e96e53fbf1e96161fc24897400db
fixing tests, updating README and pytest_coverage module doc string

--- a/test_pytest_coverage.py
+++ b/test_pytest_coverage.py
@@ -18,7 +18,7 @@ def test_functional(testdir):
     print type(result.stdout)
     print repr(result.stdout)
     print
-    assert result.stdout.fnmatch_lines([
+    result.stdout.fnmatch_lines([
         '*Processing Coverage*',
         'test_functional*4*3*75%*',
     ])
@@ -31,7 +31,7 @@ def test_coverage_is_not_imported(testdi
         """)
     result = testdir.runpytest()
     assert result.ret == 0
-    assert result.stdout.fnmatch_lines([
+    result.stdout.fnmatch_lines([
         '*1 passed*',
         ])
 
@@ -45,7 +45,7 @@ def test_cover_package(testdir):
     result = testdir.runpytest('--cover=test_cover_package',
             '--cover-report=report')
     assert result.ret == 0
-    assert result.stdout.fnmatch_lines([
+    result.stdout.fnmatch_lines([
         '*Processing Coverage*',
         'test_cover_package*4*3*75%*',
     ])

--- a/README.txt
+++ b/README.txt
@@ -7,12 +7,8 @@ issue::
 
     python setup.py install 
 
-which will install dependencies as well. 
+which will install dependencies (Ned's coverage module) as well. 
 
 For more info on py.test go here:
 
     http://pytest.org
-
-Have fun, 
-
-holger krekel

--- a/pytest_coverage.py
+++ b/pytest_coverage.py
@@ -1,15 +1,32 @@
 """
-Write and report coverage data with the 'coverage' package.
-Original code by Ross Lawley. 
+Write and report coverage data with the 'coverage' package.  
 
-Requires Ned Batchelder's excellent coverage:
-http://nedbatchelder.com/code/coverage/
+Note: Original code by Ross Lawley. 
+
+Install
+--------------
+
+Use pip to (un)install::
+
+    pip install pytest-coverage 
+    pip uninstall pytest-coverage 
+
+or alternatively use easy_install to install::
+
+    easy_install pytest-coverage 
+
+
+Usage 
+-------------
+
+To get full test coverage reports for a particular package type::
+
+    py.test --cover-report=report 
+
 """
 
 import sys
 
-from coverage import coverage
-
 def pytest_addoption(parser):
     group = parser.getgroup('Coverage options')
     group.addoption('--cover', action='append', default=[],
@@ -48,6 +65,7 @@ class DoCoverage:
 
     def __init__(self, config):
         self.config = config 
+        from coverage import coverage
 
         self._coverage = coverage()
         self._coverage.use_cache(False)



More information about the pytest-commit mailing list