From 1c29ef3e4b871508bb2defd6b47b9a745547b626 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 13 Nov 2021 19:23:24 -0500 Subject: refactor: specialize exceptions CoverageException is fine as a base class, but not good to use for raising (and catching sometimes). Introduce specialized exceptions that allow third-party tools to integrate better. --- tests/test_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test_files.py') diff --git a/tests/test_files.py b/tests/test_files.py index de0dbbd5..0780fdb3 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -10,7 +10,7 @@ import pytest from coverage import env from coverage import files -from coverage.exceptions import CoverageException +from coverage.exceptions import ConfigError from coverage.files import ( TreeMatcher, FnmatchMatcher, ModuleMatcher, PathAliases, find_python_files, abs_file, actual_path, flat_rootname, fnmatches_to_regex, @@ -291,7 +291,7 @@ class PathAliasesTest(CoverageTest): def test_cant_have_wildcard_at_end(self, badpat): aliases = PathAliases() msg = "Pattern must not end with wildcards." - with pytest.raises(CoverageException, match=msg): + with pytest.raises(ConfigError, match=msg): aliases.add(badpat, "fooey") def test_no_accidental_munging(self): -- cgit v1.2.1