1 | """Base classes.""" |
||
2 | |||
3 | 1 | from abc import ABCMeta, abstractmethod |
|
4 | |||
5 | 1 | from six import with_metaclass |
|
6 | |||
7 | |||
8 | class BasePlugin(with_metaclass(ABCMeta)): # pragma: no cover (abstract class) |
||
0 ignored issues
–
show
|
|||
9 | """Base class for coverage plugins.""" |
||
10 | |||
11 | @abstractmethod |
||
12 | def match(self, cwd): |
||
13 | """Determine if the current directory contains coverage data. |
||
14 | |||
15 | :return bool: Indicates the current directory can be processesed. |
||
16 | |||
17 | """ |
||
18 | |||
19 | @abstractmethod |
||
20 | def run(self, cwd): |
||
21 | """Extract the coverage data from the current directory. |
||
22 | |||
23 | :return float: Percentange of lines covered. |
||
24 | |||
25 | """ |
||
26 |
Abstract classes which are used only once can usually be inlined into the class which already uses this abstract class.