diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4e38a622f445da2db051b862cccb5cdd0aa0b19e..9aed78e9c36a1e3bdde697d46e6bed4e06d95971 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,4 +3,4 @@ job: - python3 setup.py build - python3 setup.py build_ext -i - make -C doc clean && make -C doc html - - py.test --cov=kwant kwant \ No newline at end of file + - py.test --cov=kwant --flakes kwant diff --git a/kwant/digest.py b/kwant/digest.py index 0b502d5f2992477ee12d721111a104b0fa481536..cd53095efa209deb5e55926a809ae6715f2b1b3e 100644 --- a/kwant/digest.py +++ b/kwant/digest.py @@ -22,7 +22,6 @@ this module. from math import pi, log, sqrt, cos from hashlib import md5 from struct import unpack -import sys __all__ = ['uniform', 'gauss', 'test'] diff --git a/kwant/solvers/default.py b/kwant/solvers/default.py index 10081cf679bfbe480a9f85157554f1513d21fcbc..e07f19aa8896a6044261f6d7fac93f5dddfe3060 100644 --- a/kwant/solvers/default.py +++ b/kwant/solvers/default.py @@ -6,7 +6,7 @@ # the file AUTHORS.rst at the top-level directory of this distribution and at # http://kwant-project.org/authors. -__all__ = ['smatrx', 'ldos', 'wave_function', 'greens_function'] +__all__ = ['smatrix', 'ldos', 'wave_function', 'greens_function'] # MUMPS usually works best. Use SciPy as fallback. import warnings diff --git a/kwant/solvers/sparse.py b/kwant/solvers/sparse.py index 69f9a3a83534eb37885c6488d543c35edcaa55fc..b9b7bb046b2f7395caeb81a5808d5023b2401d04 100644 --- a/kwant/solvers/sparse.py +++ b/kwant/solvers/sparse.py @@ -8,7 +8,6 @@ __all__ = ['smatrix', 'greens_function', 'ldos', 'wave_function', 'Solver'] -import warnings import numpy as np import scipy.sparse as sp from . import common diff --git a/kwant/solvers/tests/test_sparse.py b/kwant/solvers/tests/test_sparse.py index 95a2afe36cb1910f740feb6784e233fa7577f88b..1c432e2ef3fa3198efb5517a16956d4fc0e386d5 100644 --- a/kwant/solvers/tests/test_sparse.py +++ b/kwant/solvers/tests/test_sparse.py @@ -7,7 +7,6 @@ # http://kwant-project.org/authors. from kwant.solvers.sparse import smatrix, greens_function, ldos, wave_function -import kwant.solvers.sparse from . import _test_sparse def test_output(): diff --git a/kwant/system.py b/kwant/system.py index afdfa5137312cbfc7783ef8cd114435bfb5e9711..5b856674d24e9b28450d0007f23d07a55e7c94ed 100644 --- a/kwant/system.py +++ b/kwant/system.py @@ -11,7 +11,6 @@ __all__ = ['System', 'FiniteSystem', 'InfiniteSystem'] import abc -import types from copy import copy from . import _system diff --git a/kwant/tests/test_plotter.py b/kwant/tests/test_plotter.py index 462cb2b37eabaa8710fbe3188a6c2cfb4a457024..b1f6f2b7916290650edef7cd6d27bf62583fe1a3 100644 --- a/kwant/tests/test_plotter.py +++ b/kwant/tests/test_plotter.py @@ -15,7 +15,7 @@ import pytest if plotter.mpl_enabled: from mpl_toolkits import mplot3d - from matplotlib import pyplot + from matplotlib import pyplot # pragma: no flakes def test_importable_without_matplotlib(): diff --git a/pytest.ini b/pytest.ini index a77b6256e5588bd007946c35beef09cc2689a122..6c8258daf2ed83d5fb6da872d379c2ad36d42c25 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,6 @@ [pytest] testpaths = kwant +flakes-ignore = + __init__.py UnusedImport + graph/tests/test_scotch.py UndefinedName + graph/tests/test_dissection.py UndefinedName