Skip to content

Commit 9cf199b

Browse files
authored
Merge pull request #24 from cclib/coverage
Handle updated version of DataSuite
2 parents e6186f1 + 140aa79 commit 9cf199b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

sphinx/coverage.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@
3939
# this issue; although that doesn't alleviate the issue entirely, and the fix
4040
# needs to happen in the cclib code.
4141
try:
42+
from test_data import all_modules
43+
from test_data import all_parsers
4244
from test_data import parser_names
4345
from test_data import DataSuite
46+
import inspect
47+
ds_args = inspect.getargspec(DataSuite.__init__).args
4448
thispath = os.path.dirname(os.path.realpath(__file__))
4549
logpath = thispath + "/coverage.tests.log"
4650
try:
@@ -49,7 +53,12 @@
4953
sys.stdout = flog
5054
alltests = {}
5155
for p in parser_names:
52-
suite = DataSuite(argv=[p], stream=flog)
56+
# newer versions, changed in rev 17b5b263
57+
if 'parsers' in ds_args:
58+
suite = DataSuite(parsers={p: all_parsers[p]}, modules=all_modules, stream=flog)
59+
else:
60+
assert 'argv' in ds_args
61+
suite = DataSuite(argv=[p], stream=flog)
5362
suite.testall()
5463
alltests[p] = [{'data': t.data} for t in suite.alltests]
5564
sys.stdout = stdout_backup

0 commit comments

Comments
 (0)