From 1ca7c5b8bc6edf785ef0af2adfd9bc9b82f70cd4 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 27 Jun 2018 15:09:56 -0400 Subject: Lose a little less information when scrubbing HTML --- tests/test_farm.py | 6 +++--- tests/test_html.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/test_farm.py b/tests/test_farm.py index a23931a5..942bdd5c 100644 --- a/tests/test_farm.py +++ b/tests/test_farm.py @@ -219,8 +219,8 @@ def compare(dir1, dir2, file_pattern=None, size_within=0, left_extra=False, scru `left_extra` true means the left directory can have extra files in it without triggering an assertion. - `scrubs` is a list of pairs, regexes to find and literal strings to - replace them with to scrub the files of unimportant differences. + `scrubs` is a list of pairs, regexes to find and replace to scrub the + files of unimportant differences. An assertion will be raised if the directories fail one of their matches. @@ -378,7 +378,7 @@ def scrub(strdata, scrubs): """ for rgx_find, rgx_replace in scrubs: - strdata = re.sub(rgx_find, rgx_replace.replace("\\", "\\\\"), strdata) + strdata = re.sub(rgx_find, rgx_replace, strdata) return strdata diff --git a/tests/test_html.py b/tests/test_html.py index 1c1f6857..bcc5f8bf 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -572,7 +572,7 @@ def compare_html(dir1, dir2): (r'coverage.py v[\d.abc]+', 'coverage.py vVER'), (r'created at \d\d\d\d-\d\d-\d\d \d\d:\d\d', 'created at DATE'), # Some words are identifiers in one version, keywords in another. - (r'(print|True|False)', 'XXX'), + (r'(print|True|False)', r'\2'), # Occasionally an absolute path is in the HTML report. (TESTS_DIR, 'TESTS_DIR'), (r'/Users/ned/coverage/trunk/tests', 'TESTS_DIR'), -- cgit v1.2.1