diff --git a/gandy/tests/test_metrics/test_metrics.py b/gandy/tests/test_metrics/test_metrics.py index 2f6022a..e81fd74 100644 --- a/gandy/tests/test_metrics/test_metrics.py +++ b/gandy/tests/test_metrics/test_metrics.py @@ -41,13 +41,6 @@ def test_calculate(self): subject = metrics.MSE(predictions=np.array([0, 1, 2]), real="0, 1, 2").calculate() - # failure case: Uncertainties given when none expected - with self.assertRaises(TypeError): - subject = metrics.MSE(predictions=np.array([0, 1, 2]), - real=np.array([0, 1, 2]), - uncertainties=np.array([0, 0.5, 1])).\ - calculate() - # check to make sure necessary attributes are inputted subject = metrics.MSE(predictions=np.array([0, 1, 2]), real=np.array([0, 1, 2])) @@ -75,13 +68,6 @@ def test_calculate(self): subject = metrics.RMSE(predictions=np.array([0, 1, 2]), real="0, 1, 2").calculate() - # failure case: Uncertainties given when none expected - with self.assertRaises(TypeError): - subject = metrics.RMSE(predictions=np.array([0, 1, 2]), - real=np.array([0, 1, 2]), - uncertainties=np.array([0, 0.5, 1])).\ - calculate() - # check to make sure necessary attributes are inputted subject = metrics.RMSE(predictions=np.array([0, 1, 2]), real=np.array([0, 1, 2])) @@ -109,12 +95,6 @@ def test_calculate(self): subject = metrics.F1(predictions=np.array([0, 1, 2]), real="0, 1, 2").calculate() - # failure case: Uncertainties given when none expected - with self.assertRaises(TypeError): - subject = metrics.F1(predictions=np.array([0, 1, 2]), - real=np.array([0, 1, 2]), - uncertainties=np.array([0, 0.5, 1])).\ - calculate() # check to make sure necessary attributes are inputted subject = metrics.F1(predictions=np.array([0, 1, 2]), @@ -125,7 +105,7 @@ def test_calculate(self): self.assertTrue(subject.uncertainties is None) # check to make sure output is correct type - self.assertTrue(isinstance(subject.calculate(), (float, int))) + self.assertTrue(isinstance(subject.calculate(), tuple)) class TestAccuracy(unittest.TestCase): @@ -143,12 +123,6 @@ def test_calculate(self): subject = metrics.Accuracy(predictions=np.array([0, 1, 2]), real="0, 1, 2").calculate() - # failure case: Uncertainties given when none expected - with self.assertRaises(TypeError): - subject = metrics.Accuracy(predictions=np.array([0, 1, 2]), - real=np.array([0, 1, 2]), - uncertainties=np.array([0, 0.5, 1])).\ - calculate() # check to make sure necessary attributes are inputted subject = metrics.Accuracy(predictions=np.array([0, 1, 2]), @@ -159,7 +133,7 @@ def test_calculate(self): self.assertTrue(subject.uncertainties is None) # check to make sure output is correct type - self.assertTrue(isinstance(subject.calculate(), (float, int))) + self.assertTrue(isinstance(subject.calculate(), tuple)) class TestUCP(unittest.TestCase): @@ -203,4 +177,4 @@ def test_calculate(self): self.assertTrue(subject.uncertainties is not None) # check to make sure output is correct type - self.assertTrue(isinstance(subject.calculate(), (float, int))) + self.assertTrue(isinstance(subject.calculate(), tuple))