Skip to content

Commit

Permalink
clean test_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Henley13 committed May 5, 2020
1 parent e564089 commit 5f02000
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tests/stack/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def foo(a, b, c, d, e, f, g, h):
foo(a=[], b="bar", c=5, d=2.5, e=np.zeros((3, 3)),
f=True, g=pd.DataFrame(), h=pd.Series())

return


def test_check_df():
# build a dataframe to test
Expand Down Expand Up @@ -90,8 +88,6 @@ def test_check_df():
features=["A", "B", "C", "D"],
features_without_nan=["A", "B", "C", "D"])

return


def test_check_array():
# build some arrays to test
Expand Down Expand Up @@ -121,8 +117,6 @@ def test_check_array():
with pytest.raises(ValueError):
stack.check_array(d, allow_nan=False)

return


def test_check_range_value():
# build some arrays to test
Expand All @@ -138,8 +132,6 @@ def test_check_range_value():
with pytest.raises(ValueError):
stack.check_range_value(a, min_=None, max_=8)

return


# ### Test recipes ###

Expand Down Expand Up @@ -212,8 +204,6 @@ def test_check_recipe():
with pytest.raises(TypeError):
stack.check_recipe(bad_recipe_5, data_directory=None)

return


def test_fit_recipe():
# build a recipe to fit
Expand All @@ -240,8 +230,6 @@ def test_fit_recipe():
new_recip_bis = fit_recipe(new_recipe)
assert new_recip_bis == new_recipe

return


def test_path_from_recipe():
# build a temporary directory with one file
Expand All @@ -261,8 +249,6 @@ def test_path_from_recipe():
path_dapi = get_path_from_recipe(good_recipe, tmp_dir, c=0)
assert os.path.isfile(path_dapi)

return


def test_element_per_dimension():
# build a recipe to test
Expand All @@ -278,8 +264,6 @@ def test_element_per_dimension():
assert nb_c == 2
assert nb_z == 1

return


def test_nb_fov():
# case when 'fov' key is a string
Expand Down Expand Up @@ -317,22 +301,16 @@ def test_nb_fov():
"pattern": "opt_c_fov.ext"}
count_nb_fov(bad_recipe)

return


# ### Others ###

def test_margin_value():
# test margin value
assert stack.get_margin_value() >= 2

return


def test_epsilon_float_32():
# test epsilon value and dtype
eps = stack.get_eps_float32()
assert eps < 1e-5
assert isinstance(eps, np.float32)

return

0 comments on commit 5f02000

Please sign in to comment.