Skip to content

Commit be7c11f

Browse files
committed
passed all test
1 parent 99e9fc7 commit be7c11f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tests/test_eda_utils_py.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import altair as alt
55
from pandas.api.types import is_numeric_dtype
66
import numpy as np
7-
7+
from pytest import raises
88

99
def test_version():
1010
assert __version__ == '0.1.0'
@@ -49,34 +49,34 @@ def test_outlier_identifier():
4949
})
5050

5151
# Test if the imput is not dataFrame
52-
with raise(TypeError):
52+
with raises(TypeError):
5353
eda_utils_py.outlier_identifier("not dataframe")
5454

5555
# Test if columns input is not list
56-
with raise(TypeError):
56+
with raises(TypeError):
5757
eda_utils_py.outlier_identifier(test_df, columns=2)
5858

5959
# Test if input column list is in the dataframe
60-
with raise(TypeError):
60+
with raises(Exception):
6161
eda_utils_py.outlier_identifier(test_df, columns=["not in"])
6262

6363
# Test if method input is not one of three methods provided
64-
with raise(TypeError):
64+
with raises(Exception):
6565
eda_utils_py.outlier_identifier(test_df, columns=["SepalLengthCm"], method = "no")
6666

6767
# Test if column selected included non-numeric columns
68-
with raise(Exception):
68+
with raises(Exception):
6969
eda_utils_py.outlier_identifier(test_df, columns=["Species"])
7070

7171
assert pd.DataFrame.equals(
72-
outlier_identifier(test_df, test_column), trim_output
72+
eda_utils_py.outlier_identifier(test_df, test_column), trim_output
7373
), "Default test not pass"
7474
assert pd.DataFrame.equals(
75-
outlier_identifier(test_df, test_column,method = "median"), median_output
75+
eda_utils_py.outlier_identifier(test_df, test_column,method = "median"), median_output
7676
), "The median method is not correct"
7777
assert pd.DataFrame.equals(
78-
outlier_identifier(test_df, test_column, method = "mean"), mean_output
78+
eda_utils_py.outlier_identifier(test_df, test_column, method = "mean"), mean_output
7979
), "The mean method is not correct"
8080
assert pd.DataFrame.equals(
81-
outlier_identifier(test_df, columns = ["SepalLengthCm"], method = "mean"), column_output
81+
eda_utils_py.outlier_identifier(test_df, columns = ["SepalLengthCm"], method = "mean"), column_output
8282
), "The selected column method is not correct"

0 commit comments

Comments
 (0)