Switch to pytest 2.8.
Closes #1077. There were two issues: - Paths for coverage.py suddenly were absolute instead of relative, so we strip the common base part if that happens. /home/florian/proj/qutebrowser/git/qutebrowser/browser/cookies.py has 100% coverage but is not in perfect_files! /home/florian/proj/qutebrowser/git/qutebrowser/browser/http.py has 100% coverage but is not in perfect_files! [...] - There was an io.UnsupportedOperationError in test_check_coverage.py because of pytest-faulthandler, so we just don't load that in the subprocess.
This commit is contained in:
parent
416cfaf002
commit
3680f01576
@ -34,6 +34,8 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir,
|
|||||||
|
|
||||||
from scripts import utils
|
from scripts import utils
|
||||||
|
|
||||||
|
import qutebrowser
|
||||||
|
|
||||||
|
|
||||||
Message = collections.namedtuple('Message', 'typ, text')
|
Message = collections.namedtuple('Message', 'typ, text')
|
||||||
MsgType = enum.Enum('MsgType', 'insufficent_coverage, perfect_file')
|
MsgType = enum.Enum('MsgType', 'insufficent_coverage, perfect_file')
|
||||||
@ -169,6 +171,14 @@ def check(fileobj, perfect_files):
|
|||||||
|
|
||||||
for klass in classes:
|
for klass in classes:
|
||||||
filename = klass.attrib['filename']
|
filename = klass.attrib['filename']
|
||||||
|
|
||||||
|
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',
|
||||||
|
'..'))
|
||||||
|
if os.path.isabs(filename):
|
||||||
|
common_path = os.path.commonpath([basedir, filename])
|
||||||
|
if common_path:
|
||||||
|
filename = filename[len(common_path):].lstrip('/')
|
||||||
|
|
||||||
line_cov = float(klass.attrib['line-rate']) * 100
|
line_cov = float(klass.attrib['line-rate']) * 100
|
||||||
branch_cov = float(klass.attrib['branch-rate']) * 100
|
branch_cov = float(klass.attrib['branch-rate']) * 100
|
||||||
|
|
||||||
|
@ -51,7 +51,8 @@ class CovtestHelper:
|
|||||||
coveragerc = str(self._testdir.tmpdir / 'coveragerc')
|
coveragerc = str(self._testdir.tmpdir / 'coveragerc')
|
||||||
return self._testdir.runpytest('--cov=module',
|
return self._testdir.runpytest('--cov=module',
|
||||||
'--cov-config={}'.format(coveragerc),
|
'--cov-config={}'.format(coveragerc),
|
||||||
'--cov-report=xml')
|
'--cov-report=xml',
|
||||||
|
plugins=['no:faulthandler'])
|
||||||
|
|
||||||
def check(self, perfect_files=None):
|
def check(self, perfect_files=None):
|
||||||
"""Run check_coverage.py and run its return value."""
|
"""Run check_coverage.py and run its return value."""
|
||||||
|
Loading…
Reference in New Issue
Block a user