-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcover-plugin.txt
54 lines (40 loc) · 1.32 KB
/
cover-plugin.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
== nose cover plugin flow ==
- configure:
set self.coverPackages: list of names of packages
- begin:
self.skipModules = sys.modules.keys()[:]
set coverage.exclude (why?)
coverage.start
- report:
coverage.stop()
modules = [ module
for name, module in sys.modules.items()
if self.wantModuleCoverage(name, module) ]
coverage.report(modules)
- wantModuleCoverage(name, module):
if self.coverPackages:
for package in self.coverPackages:
want_it = False
if name.startswith(package):
if self.coverTests:
want_it = True
else:
want_it = not self.conf.testMatch.search(name)
if want_it:
return True
if name in self.skipModules:
return False
if self.conf.testMatch.search(name) and not self.coverTests:
return False
return not self.coverPackages
- wantFile:
source, include, omit:
# self.source is a list of canonical directories for the packages.
# canon_dir is the canonical directory containing the source file.
if self.source:
for s in self.source:
if is_contained(s, canon_dir):
break
else:
# This file wasn't in any source.
return False