Exemplo n.º 1
0
    def test_window_fraction_is_fraction(self):
        window_fraction = 2

        with pytest.raises(ValueError):
            find_outliers(np.zeros(5), window_fraction=window_fraction)
Exemplo n.º 2
0
 def test_data_can_be_1d(self):
     find_outliers(np.zeros(5))
Exemplo n.º 3
0
 def test_threshold_not_none(self):
     with pytest.raises(TypeError):
         find_outliers(np.zeros(5), None)
Exemplo n.º 4
0
 def test_threshold_not_inf(self):
     with pytest.raises(ValueError):
         find_outliers(np.zeros(5), np.inf)
Exemplo n.º 5
0
 def test_threshold_not_negative(self):
     with pytest.raises(ValueError):
         find_outliers(np.zeros(5), -1)
Exemplo n.º 6
0
    def test_cannot_send_empty(self):
        with pytest.raises(ValueError):
            find_outliers([])

        with pytest.raises(ValueError):
            find_outliers(np.array([]))
Exemplo n.º 7
0
 def test_cannot_send_none(self):
     with pytest.raises(Exception):
         find_outliers(None)
Exemplo n.º 8
0
 def test_data_can_be_linear(self):
     find_outliers(np.linspace(0, 5, 100))
Exemplo n.º 9
0
    def test_window_fraction_is_fraction(self, window_fraction):
        if 0 <= window_fraction <= 1:
            return

        with pytest.raises(ValueError):
            find_outliers(np.zeros(5), window_fraction=window_fraction)