def test_area_circ(self):
     """Test the area values against a reference for r >= 0."""
     self.assertEqual(tf.area_circ(1), np.pi)
     self.assertEqual(tf.area_circ(0), 0)
     self.assertEqual(tf.area_circ(2.1), np.pi * 2.1**2)
def test_values():
    """Make sure value errors are recognized for area_circ."""
    with pytest.raises(ValueError):
        tf.area_circ(-5)
def test_area_circ():
    """Test the area values against a reference for r >= 0."""
    assert tf.area_circ(1) == np.pi, "should return pi"
    assert tf.area_circ(0) == 0
    assert tf.area_circ(2.1) == np.pi * 2.1**2
Exemplo n.º 4
0
def test_area_circ(myinput, myref):
    """Test the area values against a reference for r >= 0."""
    print(myinput)
    assert tf.area_circ(myinput) == myref