diff options
Diffstat (limited to 'tests/test_farm.py')
-rw-r--r-- | tests/test_farm.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/test_farm.py b/tests/test_farm.py index 92bd968a..daa83d92 100644 --- a/tests/test_farm.py +++ b/tests/test_farm.py @@ -1,3 +1,6 @@ +# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 +# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt + """Run tests in the farm sub-directory. Designed for nose.""" import difflib @@ -14,7 +17,7 @@ from nose.plugins.skip import SkipTest from tests.helpers import run_command from tests.backtest import execfile # pylint: disable=redefined-builtin -from coverage.control import _TEST_NAME_FILE +from coverage.debug import _TEST_NAME_FILE def test_farm(clean_only=False): @@ -228,8 +231,8 @@ class FarmTestCase(object): without triggering an assertion. `right_extra` means the right directory can. - `scrubs` is a list of pairs, regex find and replace patterns to use to - scrub the files of unimportant differences. + `scrubs` is a list of pairs, regexes to find and literal strings to + replace them with to scrub the files of unimportant differences. An assertion will be raised if the directories fail one of their matches. @@ -309,7 +312,7 @@ class FarmTestCase(object): """ for rgx_find, rgx_replace in scrubs: - strdata = re.sub(rgx_find, rgx_replace, strdata) + strdata = re.sub(rgx_find, re.escape(rgx_replace), strdata) return strdata def contains(self, filename, *strlist): |