traceback when combining data

Issue #414 invalid
Matthew Stoltenberg created an issue

Not sure if this is a problem with the new Coverage 4.0 or with the nose coverage plugin.

print("Hello World")

import os
import unittest

class FooTest(unittest.TestCase):

    def test_01(self):
        os.system('coverage run --branch --parallel-mode')


(PY3ENV) $ nosetests --with-coverage 
Hello World
Traceback (most recent call last):
  File "/home/sto62746/work/coverage/PY3ENV/bin/nosetests", line 11, in <module>
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/", line 121, in __init__
  File "/usr/lib64/python3.4/unittest/", line 93, in __init__
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/", line 207, in runTests
    result =
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/", line 66, in run
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/", line 110, in printErrors
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/plugins/", line 99, in __call__
    return*arg, **kw)
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/plugins/", line 167, in simple
    result = meth(*arg, **kw)
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/nose/plugins/", line 183, in report
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/coverage/", line 787, in combine
    self.data_files.combine_parallel_data(, aliases=aliases, data_paths=data_paths)
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/coverage/", line 700, in combine_parallel_data
    data.update(new_data, aliases=aliases)
  File "/home/sto62746/work/coverage/PY3ENV/lib64/python3.4/site-packages/coverage/", line 475, in update
    raise CoverageException("Can't combine arc data with line data")
coverage.misc.CoverageException: Can't combine arc data with line data

version info

(PY3ENV) $ python --version
Python 3.4.2
(PY3ENV) $ pip list
coverage (4.0)
nose (1.3.7)
pip (7.1.2)
setuptools (12.0.3)

Comments (4)

  1. Ned Batchelder repo owner

    This happens because you are running coverage twice: once to measure, and then again in the subprocess to measure But the outer one has branch=False (since you haven't specified it), and the inner one has branch=True. Use a .coveragerc file to set options that you want to apply everywhere.

    As an aside, using os.system to run coverage inside a test suite is a really odd thing to do. There are probably better ways to accomplish what you want. :)

  2. Matthew Stoltenberg reporter

    DOH! I didn't even notice I wasn't calling nosetests with --cover-branches. Apparently the older version of Coverage was more forgiving...

  3. Log in to comment