import numpy as np
from numpy.testing import assert_equal, assert_allclose
from astropy.cosmology import Planck13 as cosmo

import halobias

def test_Mnl_z0():
    z = 0.
    h = cosmo.h

    def _check_bias_z0(m,ans):
        b = halobias.bias(m,z)
        assert_allclose(b,ans)

    #integer multiples of non-linear mass
    M_nl = (8.73/h) * 10.**12.
    mass = np.array([0.,1.,2.,10., 100.]) * M_nl
    
    #corresponding bias at z=0
    answer = [0.66, 0.9236707, 1.06577485, 1.64530492, 4.127912607]
    
    for m, ans in zip(mass, answer):
        yield  _check_bias_z0, m, ans

@@ -41,22 +41,8 @@
 port
- assert_equal,
  ass
@@ -120,16 +120,17 @@
 lobias%0A%0A
+%0A
 def test
@@ -193,16 +193,17 @@
 as_z0(m,
+ 
 ans):%0A  
@@ -228,16 +228,17 @@
 .bias(m,
+ 
 z)%0A     
@@ -258,16 +258,17 @@
 close(b,
+ 
 ans)%0A%0A  
@@ -270,16 +270,17 @@
 )%0A%0A    #
+ 
 integer 
@@ -367,14 +367,17 @@
 %5B0.,
+ 
 1.,
+ 
 2.,
+ 
 10.,
@@ -395,18 +395,15 @@
 _nl%0A
-    
 %0A    #
+ 
 corr
@@ -492,20 +492,16 @@
 912607%5D%0A
-    
 %0A    for
@@ -544,17 +544,16 @@
   yield 
- 
 _check_b

make test_halobias.py flake8 happy