From 291ec95b6c17c28371280e7dcde58b1cc9dd6a82 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 27 Dec 2009 20:33:23 -0500 Subject: Remove some redundancy in the farm tests. --HG-- rename : test/farm/html/run_x_xml.py => test/farm/html/run_a_xml.py --- test/farm/html/gold_x_xml/coverage.xml | 2 +- test/farm/html/run_a.py | 1 + test/farm/html/run_a_xml.py | 21 +++++++++++++++++++++ test/farm/html/run_x_xml.py | 20 -------------------- test/farm/html/src/x.py | 7 ------- 5 files changed, 23 insertions(+), 28 deletions(-) create mode 100644 test/farm/html/run_a_xml.py delete mode 100644 test/farm/html/run_x_xml.py delete mode 100644 test/farm/html/src/x.py diff --git a/test/farm/html/gold_x_xml/coverage.xml b/test/farm/html/gold_x_xml/coverage.xml index 8c009f5d..37027efb 100644 --- a/test/farm/html/gold_x_xml/coverage.xml +++ b/test/farm/html/gold_x_xml/coverage.xml @@ -6,7 +6,7 @@ - + diff --git a/test/farm/html/run_a.py b/test/farm/html/run_a.py index 047d8982..92d02348 100644 --- a/test/farm/html/run_a.py +++ b/test/farm/html/run_a.py @@ -4,6 +4,7 @@ def html_it(): cov = coverage.coverage() cov.start() import a + reload(a) # Because other test files import a, we have to reload to run it. cov.stop() cov.html_report(a, directory="../html_a") diff --git a/test/farm/html/run_a_xml.py b/test/farm/html/run_a_xml.py new file mode 100644 index 00000000..375be2af --- /dev/null +++ b/test/farm/html/run_a_xml.py @@ -0,0 +1,21 @@ +def html_it(): + """Run coverage and make an XML report for x.""" + import coverage + cov = coverage.coverage() + cov.start() + import a + reload(a) # Because other test files import a, we have to reload to run it. + cov.stop() + cov.xml_report(a, outfile="../xml/coverage.xml") + +import os +if not os.path.exists("xml"): + os.makedirs("xml") + +runfunc(html_it, rundir="src") + +compare("gold_x_xml", "xml", scrubs=[ + (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), + (r' version="[-.\w]+"', ' version="VERSION"'), + ]) +clean("xml") diff --git a/test/farm/html/run_x_xml.py b/test/farm/html/run_x_xml.py deleted file mode 100644 index fe9cefa7..00000000 --- a/test/farm/html/run_x_xml.py +++ /dev/null @@ -1,20 +0,0 @@ -def html_it(): - """Run coverage and make an XML report for x.""" - import coverage - cov = coverage.coverage() - cov.start() - import x - cov.stop() - cov.xml_report(x, outfile="../xml/coverage.xml") - -import os -if not os.path.exists("xml"): - os.makedirs("xml") - -runfunc(html_it, rundir="src") - -compare("gold_x_xml", "xml", scrubs=[ - (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), - (r' version="[-.\w]+"', ' version="VERSION"'), - ]) -clean("xml") diff --git a/test/farm/html/src/x.py b/test/farm/html/src/x.py deleted file mode 100644 index 9e71aebd..00000000 --- a/test/farm/html/src/x.py +++ /dev/null @@ -1,7 +0,0 @@ -# A test file for HTML reporting by coverage. - -if 1 < 2: - # Needed a < to look at HTML entities. - a = 3 -else: - a = 4 -- cgit v1.2.1