def test_is_real_number(): non_reals = [None, 1j, 'yes'] yes_reals = [-1e12, -1, -1.0, 0, 1, 1.0, 1e12] # test single value for nr in non_reals: assert not is_real_number(nr) for yr in yes_reals: assert is_real_number(yr)