summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-05-09 21:10:17 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-05-09 21:10:17 -0400
commit8fbe22896bff70a8c72116eb222cd317f6db36d0 (patch)
tree51a29812bb67f8eec0bbf8bca240b0b93caa7c2c
parent1f7fcec9352691a6e7a90c20e13dc59b65865030 (diff)
downloadpython-coveragepy-git-8fbe22896bff70a8c72116eb222cd317f6db36d0.tar.gz
More docstrings
-rw-r--r--test/coveragetest.py2
-rw-r--r--test/test_api.py2
-rw-r--r--test/test_cmdline.py2
-rw-r--r--test/test_data.py5
-rw-r--r--test/test_execfile.py1
-rw-r--r--test/test_farm.py9
6 files changed, 20 insertions, 1 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py
index 46572c56..0fb8d163 100644
--- a/test/coveragetest.py
+++ b/test/coveragetest.py
@@ -27,6 +27,8 @@ class Tee(object):
class CoverageTest(unittest.TestCase):
+ """A base class for Coverage test cases."""
+
def setUp(self):
# Create a temporary directory.
self.noise = str(random.random())[2:]
diff --git a/test/test_api.py b/test/test_api.py
index 803ebfe3..f16c35dd 100644
--- a/test/test_api.py
+++ b/test/test_api.py
@@ -8,6 +8,7 @@ from coveragetest import CoverageTest
class ApiTest(CoverageTest):
+ """Api-oriented tests for Coverage."""
def testSimple(self):
coverage.erase()
@@ -31,6 +32,7 @@ class ApiTest(CoverageTest):
self.assertEqual(missingtext, "4")
def doReportWork(self, modname):
+ """Create a module named `modname`, then measure it."""
coverage.erase()
self.makeFile(modname+".py", """\
diff --git a/test/test_cmdline.py b/test/test_cmdline.py
index 4da542da..38f2121d 100644
--- a/test/test_cmdline.py
+++ b/test/test_cmdline.py
@@ -11,9 +11,11 @@ class CmdLineTest(CoverageTest):
"""Tests of command-line processing for Coverage."""
def help_fn(self, error=None):
+ """A mock help_fn to capture the error messages for tests."""
raise Exception(error or "__doc__")
def command_line(self, argv):
+ """Run a Coverage command line, with `argv` as arguments."""
return coverage.CoverageScript().command_line(argv, self.help_fn)
def testHelp(self):
diff --git a/test/test_data.py b/test/test_data.py
index 39d5ecd3..7a2687fd 100644
--- a/test/test_data.py
+++ b/test/test_data.py
@@ -17,11 +17,14 @@ EXECED_FILES_1_2 = [ 'a.py', 'b.py', 'c.py' ]
class DataTest(CoverageTest):
-
+ """Test cases for coverage.data."""
+
def assert_summary(self, covdata, summary):
+ """Check that the summary of `covdata` is `summary`."""
self.assertEqual(covdata.summary(), summary)
def assert_executed_files(self, covdata, execed):
+ """Check that `covdata`'s executed files are `execed`."""
self.assert_equal_sets(covdata.executed_files(), execed)
def test_reading_empty(self):
diff --git a/test/test_execfile.py b/test/test_execfile.py
index de1a575c..eae227a1 100644
--- a/test/test_execfile.py
+++ b/test/test_execfile.py
@@ -8,6 +8,7 @@ from coveragetest import CoverageTest
here = os.path.dirname(__file__)
class RunTest(CoverageTest):
+ """Test cases for `run_python_file`."""
def test_run_python_file(self):
tryfile = os.path.join(here, "try_execfile.py")
diff --git a/test/test_farm.py b/test/test_farm.py
index 98f44379..26da1934 100644
--- a/test/test_farm.py
+++ b/test/test_farm.py
@@ -256,6 +256,15 @@ class FarmTestCase(object):
shutil.rmtree(cleandir)
def main():
+ """Command-line access to test_farm.
+
+ Commands:
+
+ run testcase - Run a single test case.
+ out testcase - Run a test case, but don't clean up, to see the output.
+ clean - Clean all the output for all tests.
+
+ """
op = sys.argv[1]
if op == 'run':
# Run the test for real.