|
1 # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 |
|
2 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt |
|
3 |
|
4 """Exceptions coverage.py can raise.""" |
|
5 |
|
6 |
|
7 class _BaseCoverageException(Exception): |
|
8 """The base-base of all Coverage exceptions.""" |
|
9 pass |
|
10 |
|
11 |
|
12 class CoverageException(_BaseCoverageException): |
|
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.""" |
|
28 pass |
|
29 |
|
30 |
|
31 class NoSource(CoverageException): |
|
32 """We couldn't find the source for a module.""" |
|
33 pass |
|
34 |
|
35 |
|
36 class NoCode(NoSource): |
|
37 """We couldn't find any code at all.""" |
|
38 pass |
|
39 |
|
40 |
|
41 class NotPython(CoverageException): |
|
42 """A source file turned out not to be parsable Python.""" |
|
43 pass |
|
44 |
|
45 |
|
46 class PluginError(CoverageException): |
|
47 """A plugin misbehaved.""" |
|
48 pass |
|
49 |
|
50 |
|
51 class _ExceptionDuringRun(CoverageException): |
|
52 """An exception happened while running customer code. |
|
53 |
|
54 Construct it with three arguments, the values from `sys.exc_info`. |
|
55 |
|
56 """ |
|
57 pass |
|
58 |
|
59 |
|
60 class _StopEverything(_BaseCoverageException): |
|
61 """An exception that means everything should stop. |
|
62 |
|
63 The CoverageTest class converts these to SkipTest, so that when running |
|
64 tests, raising this exception will automatically skip the test. |
|
65 |
|
66 """ |
|
67 pass |
|
68 |
|
69 |
|
70 class CoverageWarning(Warning): |
|
71 """A warning from Coverage.py.""" |
|
72 pass |