From 7684a24fc898c776511e87bfbc26b8058af5abfa Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 23 Nov 2012 22:19:30 -0500 Subject: Messages with filenames are not good as %r, because it doubles the backslashes... --- test/test_html.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test_html.py') diff --git a/test/test_html.py b/test/test_html.py index 2f1dc5d..2e84620 100644 --- a/test/test_html.py +++ b/test/test_html.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Tests that HTML generation is awesome.""" -import os.path, sys +import os.path, re, sys import coverage from coverage.misc import NotPython, NoSource @@ -302,9 +302,9 @@ class HtmlTest(CoverageTest): self.import_local_file('thefile') cov.stop() os.remove("sub/another.py") - + missing_file = os.path.join(self.temp_dir, "sub", "another.py") self.assertRaisesRegexp(NoSource, - "No source for code: '%s'" % missing_file, + "(?i)No source for code: '%s'" % re.escape(missing_file), cov.html_report ) -- cgit v1.2.1