Skip to content
Snippets Groups Projects
Commit 9c313bbd authored by Anton Akhmerov's avatar Anton Akhmerov
Browse files

use skipif from pytest

parent b94479a1
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,7 @@
# the file AUTHORS.rst at the top-level directory of this distribution and at
# http://kwant-project.org/authors.
from numpy.testing.decorators import skipif
import pytest
try:
from kwant.solvers.mumps import (
smatrix, greens_function, ldos, wave_function, options, reset_options)
......@@ -15,7 +15,8 @@ try:
except ImportError:
no_mumps = True
pytestmark = pytest.mark.skipif(no_mumps, reason="MUMPS not installed")
opt_list=[{},
{'nrhs' : 1},
{'nrhs' : 10},
......@@ -24,7 +25,6 @@ opt_list=[{},
{'nrhs' : 2, 'ordering' : 'amd', 'sparse_rhs' : True}]
@skipif(no_mumps)
def test_output():
for opts in opt_list:
reset_options()
......@@ -32,7 +32,6 @@ def test_output():
_test_sparse.test_output(smatrix)
@skipif(no_mumps)
def test_one_lead():
for opts in opt_list:
reset_options()
......@@ -40,7 +39,6 @@ def test_one_lead():
_test_sparse.test_one_lead(smatrix)
@skipif(no_mumps)
def test_smatrix_shape():
for opts in opt_list:
reset_options()
......@@ -48,14 +46,12 @@ def test_smatrix_shape():
_test_sparse.test_smatrix_shape(smatrix)
@skipif(no_mumps)
def test_two_equal_leads():
for opts in opt_list:
reset_options()
options(**opts)
_test_sparse.test_two_equal_leads(smatrix)
@skipif(no_mumps)
def test_graph_system():
for opts in opt_list:
reset_options()
......@@ -63,7 +59,6 @@ def test_graph_system():
_test_sparse.test_graph_system(smatrix)
@skipif(no_mumps)
def test_singular_graph_system():
for opts in opt_list:
reset_options()
......@@ -71,7 +66,6 @@ def test_singular_graph_system():
_test_sparse.test_singular_graph_system(smatrix)
@skipif(no_mumps)
def test_tricky_singular_hopping():
for opts in opt_list:
reset_options()
......@@ -79,7 +73,6 @@ def test_tricky_singular_hopping():
_test_sparse.test_tricky_singular_hopping(smatrix)
@skipif(no_mumps)
def test_many_leads():
for opts in opt_list:
reset_options()
......@@ -87,7 +80,6 @@ def test_many_leads():
_test_sparse.test_many_leads(greens_function, smatrix)
@skipif(no_mumps)
def test_selfenergy():
for opts in opt_list:
reset_options()
......@@ -95,7 +87,6 @@ def test_selfenergy():
_test_sparse.test_selfenergy(greens_function, smatrix)
@skipif(no_mumps)
def test_selfenergy_reflection():
for opts in opt_list:
reset_options()
......@@ -103,7 +94,6 @@ def test_selfenergy_reflection():
_test_sparse.test_selfenergy_reflection(greens_function, smatrix)
@skipif(no_mumps)
def test_very_singular_leads():
for opts in opt_list:
reset_options()
......@@ -111,7 +101,6 @@ def test_very_singular_leads():
_test_sparse.test_very_singular_leads(smatrix)
@skipif(no_mumps)
def test_ldos():
for opts in opt_list:
reset_options()
......@@ -119,7 +108,6 @@ def test_ldos():
_test_sparse.test_ldos(ldos)
@skipif(no_mumps)
def test_wavefunc_ldos_consistency():
for opts in opt_list:
options(**opts)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment