From b98757b13ad613ef741e48c209a225b9896fe8f1 Mon Sep 17 00:00:00 2001
From: Joseph Weston <joseph@weston.cloud>
Date: Tue, 3 Sep 2019 14:24:59 +0200
Subject: [PATCH] correct norbs for some tests

---
 kwant/physics/tests/test_noise.py   |  2 +-
 kwant/solvers/tests/_test_sparse.py | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kwant/physics/tests/test_noise.py b/kwant/physics/tests/test_noise.py
index 6235c2ab..1c343403 100644
--- a/kwant/physics/tests/test_noise.py
+++ b/kwant/physics/tests/test_noise.py
@@ -14,7 +14,7 @@ from kwant.physics import two_terminal_shotnoise
 from kwant._common import ensure_rng
 
 n = 5
-chain = kwant.lattice.chain(norbs=2)
+chain = kwant.lattice.chain(norbs=n)
 
 def twoterminal_system():
     rng = ensure_rng(11)
diff --git a/kwant/solvers/tests/_test_sparse.py b/kwant/solvers/tests/_test_sparse.py
index 84748086..1183f391 100644
--- a/kwant/solvers/tests/_test_sparse.py
+++ b/kwant/solvers/tests/_test_sparse.py
@@ -15,8 +15,8 @@ import kwant
 from kwant._common import ensure_rng
 
 n = 5
-chain = kwant.lattice.chain(norbs=1)
-sq = square = kwant.lattice.square(norbs=1)
+chain = kwant.lattice.chain(norbs=n)
+sq = square = kwant.lattice.square(norbs=n)
 
 
 class LeadWithOnlySelfEnergy:
@@ -111,6 +111,8 @@ def test_one_lead(smatrix):
 # Test that a system with one lead with no propagating modes has a
 # 0x0 S-matrix.
 def test_smatrix_shape(smatrix):
+    chain = kwant.lattice.chain(norbs=1)
+
     system = kwant.Builder()
     lead0 = kwant.Builder(kwant.TranslationalSymmetry((-1,)))
     lead1 = kwant.Builder(kwant.TranslationalSymmetry((1,)))
@@ -264,6 +266,8 @@ def test_singular_graph_system(smatrix):
 # zero eigenvalues than the lead hopping matrix. Older version of the
 # sparse solver failed here.
 def test_tricky_singular_hopping(smatrix):
+    sq = kwant.lattice.square(norbs=1)
+
     system = kwant.Builder()
     lead = kwant.Builder(kwant.TranslationalSymmetry((4, 0)))
 
@@ -294,6 +298,7 @@ def test_tricky_singular_hopping(smatrix):
 # Test the consistency of transmission and conductance_matrix for a four-lead
 # system without time-reversal symmetry.
 def test_many_leads(*factories):
+    sq = kwant.lattice.square(norbs=1)
     E=2.1
     B=0.01
 
@@ -512,6 +517,7 @@ def test_arg_passing(wave_function, ldos, smatrix):
     def hopping(site1, site2, a, b):
         return b - a
 
+    square = kwant.lattice.square(norbs=1)
     W = 3
     L = 4
 
-- 
GitLab