Commit 182ab7ea authored by Stefan Behnel's avatar Stefan Behnel

coverage: prefer real source file for line annotation if we find it

parent 983b6c13
......@@ -259,5 +259,10 @@ class CythonModuleReporter(FileReporter):
return '\n'.join(self._iter_source_lines())
def source_token_lines(self):
for line in self._iter_source_lines():
yield [('txt', line)]
if os.path.exists(self.filename):
with open(self.filename) as f:
for line in f:
yield [('txt', line)]
else:
for line in self._iter_source_lines():
yield [('txt', line)]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment