diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/farm/html/run_a_xml_1.py | 9 | ||||
| -rw-r--r-- | tests/farm/html/run_a_xml_2.py | 9 | ||||
| -rw-r--r-- | tests/farm/html/run_y_xml_branch.py | 9 |
3 files changed, 12 insertions, 15 deletions
diff --git a/tests/farm/html/run_a_xml_1.py b/tests/farm/html/run_a_xml_1.py index 04fdfd4b..83f8c86d 100644 --- a/tests/farm/html/run_a_xml_1.py +++ b/tests/farm/html/run_a_xml_1.py @@ -1,4 +1,4 @@ -relative_path = None +source_path = None def html_it(): """Run coverage and make an XML report for a.""" @@ -8,8 +8,8 @@ def html_it(): import a # pragma: nested cov.stop() # pragma: nested cov.xml_report(a, outfile="../xml_1/coverage.xml") - global relative_path - relative_path = cov.file_locator.relative_dir.rstrip('/') + global source_path + source_path = cov.file_locator.relative_dir.rstrip('/') import os if not os.path.exists("xml_1"): @@ -20,8 +20,7 @@ runfunc(html_it, rundir="src") compare("gold_x_xml", "xml_1", scrubs=[ (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), (r' version="[-.\w]+"', ' version="VERSION"'), - (r'<source>(\s)*?(.*)(\s)*?</source>', - '<source>%s</source>' % relative_path), + (r'<source>\s*.*?\s*</source>', '<source>%s</source>' % source_path), (r'/code/coverage/?[-.\w]*', '/code/coverage/VER'), ]) clean("xml_1") diff --git a/tests/farm/html/run_a_xml_2.py b/tests/farm/html/run_a_xml_2.py index 205ca453..6dd44225 100644 --- a/tests/farm/html/run_a_xml_2.py +++ b/tests/farm/html/run_a_xml_2.py @@ -1,4 +1,4 @@ -relative_path = None +source_path = None def html_it(): """Run coverage and make an XML report for a.""" @@ -8,8 +8,8 @@ def html_it(): import a # pragma: nested cov.stop() # pragma: nested cov.xml_report(a) - global relative_path - relative_path = cov.file_locator.relative_dir.rstrip('/') + global source_path + source_path = cov.file_locator.relative_dir.rstrip('/') import os if not os.path.exists("xml_2"): @@ -20,8 +20,7 @@ runfunc(html_it, rundir="src") compare("gold_x_xml", "xml_2", scrubs=[ (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), (r' version="[-.\w]+"', ' version="VERSION"'), - (r'<source>(\s)*?(.*)(\s)*?</source>', - '<source>%s</source>' % relative_path), + (r'<source>\s*.*?\s*</source>', '<source>%s</source>' % source_path), (r'/code/coverage/?[-.\w]*', '/code/coverage/VER'), ]) clean("xml_2") diff --git a/tests/farm/html/run_y_xml_branch.py b/tests/farm/html/run_y_xml_branch.py index 18d7f7d9..9ae9a9f0 100644 --- a/tests/farm/html/run_y_xml_branch.py +++ b/tests/farm/html/run_y_xml_branch.py @@ -1,4 +1,4 @@ -relative_path = None +source_path = None def xml_it(): """Run coverage and make an XML report for y.""" @@ -8,8 +8,8 @@ def xml_it(): import y # pragma: nested cov.stop() # pragma: nested cov.xml_report(y, outfile="../xml_branch/coverage.xml") - global relative_path - relative_path = cov.file_locator.relative_dir.rstrip('/') + global source_path + source_path = cov.file_locator.relative_dir.rstrip('/') import os if not os.path.exists("xml_branch"): @@ -20,8 +20,7 @@ runfunc(xml_it, rundir="src") compare("gold_y_xml_branch", "xml_branch", scrubs=[ (r' timestamp="\d+"', ' timestamp="TIMESTAMP"'), (r' version="[-.\w]+"', ' version="VERSION"'), - (r'<source>(\s)*?(.*)(\s)*?</source>', - '<source>%s</source>' % relative_path), + (r'<source>\s*.*?\s*</source>', '<source>%s</source>' % source_path), (r'/code/coverage/?[-.\w]*', '/code/coverage/VER'), ]) clean("xml_branch") |
