2 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt |
2 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt |
3 |
3 |
4 """Exceptions coverage.py can raise.""" |
4 """Exceptions coverage.py can raise.""" |
5 |
5 |
6 |
6 |
7 class BaseCoverageException(Exception): |
7 class _BaseCoverageException(Exception): |
8 """The base of all Coverage exceptions.""" |
8 """The base-base of all Coverage exceptions.""" |
9 pass |
9 pass |
10 |
10 |
11 |
11 |
12 class CoverageException(BaseCoverageException): |
12 class CoverageException(_BaseCoverageException): |
13 """An exception raised by a coverage.py function.""" |
13 """The base class of all exceptions raised by Coverage.py.""" |
|
14 pass |
|
15 |
|
16 |
|
17 class ConfigError(_BaseCoverageException): |
|
18 """A problem with a config file, or a value in one.""" |
|
19 pass |
|
20 |
|
21 |
|
22 class DataError(CoverageException): |
|
23 """An error in using a data file.""" |
|
24 pass |
|
25 |
|
26 class NoDataError(CoverageException): |
|
27 """We didn't have data to work with.""" |
14 pass |
28 pass |
15 |
29 |
16 |
30 |
17 class NoSource(CoverageException): |
31 class NoSource(CoverageException): |
18 """We couldn't find the source for a module.""" |
32 """We couldn't find the source for a module.""" |
27 class NotPython(CoverageException): |
41 class NotPython(CoverageException): |
28 """A source file turned out not to be parsable Python.""" |
42 """A source file turned out not to be parsable Python.""" |
29 pass |
43 pass |
30 |
44 |
31 |
45 |
32 class ExceptionDuringRun(CoverageException): |
46 class PluginError(CoverageException): |
|
47 """A plugin misbehaved.""" |
|
48 pass |
|
49 |
|
50 |
|
51 class _ExceptionDuringRun(CoverageException): |
33 """An exception happened while running customer code. |
52 """An exception happened while running customer code. |
34 |
53 |
35 Construct it with three arguments, the values from `sys.exc_info`. |
54 Construct it with three arguments, the values from `sys.exc_info`. |
36 |
55 |
37 """ |
56 """ |
38 pass |
57 pass |
39 |
58 |
40 |
59 |
41 class StopEverything(BaseCoverageException): |
60 class _StopEverything(_BaseCoverageException): |
42 """An exception that means everything should stop. |
61 """An exception that means everything should stop. |
43 |
62 |
44 The CoverageTest class converts these to SkipTest, so that when running |
63 The CoverageTest class converts these to SkipTest, so that when running |
45 tests, raising this exception will automatically skip the test. |
64 tests, raising this exception will automatically skip the test. |
46 |
65 |