def test_change_d(): """ testing changing the diameter """ c = Circle(4) c.diameter = 4 assert c.radius == 2 assert c.diameter == 4 assert round(c.area, 5) == 12.56637
def test_change_r(): """ testing changing the radius """ c = Circle(4) #"setting the radius to 2:" c.radius = 2 assert c.radius == 2 assert c.diameter == 4 assert round(c.area, 5) == 12.56637
def test_from_diameter(): c = Circle.from_diameter(6.0) assert c.radius == 3.0
def test_set_area(): # trying to set the area c = Circle(4) with pytest.raises(AttributeError): c.area = 12