diff --git a/test/pytest_coreneuron/test_nlayer.py b/test/pytest_coreneuron/test_nlayer.py index 5a7670da58..fed680f7e5 100644 --- a/test/pytest_coreneuron/test_nlayer.py +++ b/test/pytest_coreneuron/test_nlayer.py @@ -36,7 +36,7 @@ def run(self): return res -def test_nlayer(): +def get_result(): res = [] for nlayer in [1, 2, 3]: h.nlayer_extracellular(nlayer) @@ -44,16 +44,20 @@ def test_nlayer(): m = Model() res.append(m.run()) del m + return res + + +def test_nlayer(): + res = get_result() for r in res[1:]: for i in range(2): x = r[i].c().sub(res[0][i]).abs().sum() print(x) assert x < 0.01 # At 10ms. At 5ms would be 2e-5 - return res if __name__ == "__main__": - res = test_nlayer() + res = get_result() for i in range(len(res[0][0])): for j in range(2): for k in range(3): diff --git a/test/pytest_coreneuron/test_vector_api.py b/test/pytest_coreneuron/test_vector_api.py index ff90bafb2d..faaac86636 100644 --- a/test/pytest_coreneuron/test_vector_api.py +++ b/test/pytest_coreneuron/test_vector_api.py @@ -514,10 +514,10 @@ def test_vector_api(): vrand = h.Vector((1, 2, 3)) r = h.Random() r.poisson(12) - assert vrand.cl().setrand(r).to_python() == [10.0, 16.0, 11.0] - assert vrand.cl().setrand(r, 1, 2).to_python() == [1.0, 9.0, 18.0] - assert vrand.cl().addrand(r).to_python() == [9.0, 9.0, 16.0] - assert vrand.cl().addrand(r, 0, 1).to_python() == [13.0, 16.0, 3.0] + assert vrand.cl().setrand(r).to_python() == [22.0, 16.0, 16.0] + assert vrand.cl().setrand(r, 1, 2).to_python() == [1.0, 8.0, 12.0] + assert vrand.cl().addrand(r).to_python() == [7.0, 13.0, 12.0] + assert vrand.cl().addrand(r, 0, 1).to_python() == [9.0, 16.0, 3.0] """ Misc