diff options
Diffstat (limited to 'tests/test_files.py')
-rw-r--r-- | tests/test_files.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/test_files.py b/tests/test_files.py index 230cd092..85c0ac7b 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -123,18 +123,13 @@ class PathAliasesTest(CoverageTest): def test_cant_have_wildcard_at_end(self): aliases = PathAliases() - self.assertRaisesRegexp( - CoverageException, "Pattern must not end with wildcards.", - aliases.add, "/ned/home/*", "fooey" - ) - self.assertRaisesRegexp( - CoverageException, "Pattern must not end with wildcards.", - aliases.add, "/ned/home/*/", "fooey" - ) - self.assertRaisesRegexp( - CoverageException, "Pattern must not end with wildcards.", - aliases.add, "/ned/home/*/*/", "fooey" - ) + msg = "Pattern must not end with wildcards." + with self.assertRaisesRegexp(CoverageException, msg): + aliases.add("/ned/home/*", "fooey") + with self.assertRaisesRegexp(CoverageException, msg): + aliases.add("/ned/home/*/", "fooey") + with self.assertRaisesRegexp(CoverageException, msg): + aliases.add("/ned/home/*/*/", "fooey") def test_no_accidental_munging(self): aliases = PathAliases() |