diff --git a/scripts/dev/check_coverage.py b/scripts/dev/check_coverage.py index 0b6ba9a01..69aed2468 100644 --- a/scripts/dev/check_coverage.py +++ b/scripts/dev/check_coverage.py @@ -23,7 +23,7 @@ import sys import os.path -from lxml import etree +from xml.etree import ElementTree sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) @@ -57,8 +57,8 @@ def main(): assert os.path.exists(os.path.join(*path.split('/'))), path with open('coverage.xml', encoding='utf-8') as f: - tree = etree.parse(f) # pylint: disable=no-member - classes = tree.xpath('/coverage/packages/package/classes/class') + tree = ElementTree.parse(f) + classes = tree.getroot().findall('./packages/package/classes/class') status = 0 @@ -71,7 +71,7 @@ def main(): assert 0 <= branch_cov <= 100, branch_cov assert '\\' not in filename, filename - if branch_cov < 100 and klass.xpath('lines/line[@branch="true"]'): + if branch_cov < 100 and klass.find('./lines/line[@branch="true"]'): # Files without any branches have 0% coverage bad_branch_cov = True else: diff --git a/tox.ini b/tox.ini index 2a14258d3..969d7de7b 100644 --- a/tox.ini +++ b/tox.ini @@ -61,7 +61,6 @@ deps = coverage==3.7.1 pytest-cov==1.8.1 cov-core==1.15.0 - lxml==3.4.4 commands = {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} -m py.test --strict -rfEswx -v --cov qutebrowser --cov-report term --cov-report html --cov-report xml {posargs:tests} @@ -83,7 +82,6 @@ deps = pylint==1.4.4 logilab-common==1.0.2 six==1.9.0 - lxml==3.4.4 commands = {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} -m pylint scripts qutebrowser --rcfile=.pylintrc --output-format=colorized --reports=no --expected-line-ending-format=LF