def test_yearly_working_days_is_a_read_only_attribute(): """testing if the yearly_working_days attribute is a read only attribute """ wh = WorkingHours() with pytest.raises(AttributeError) as cm: wh.yearly_working_days = 260.1 assert str(cm.value) == "can't set attribute"
def test_yearly_working_days_is_a_read_only_attribute(self): """testing if the yearly_working_days attribute is a read only attribute """ wh = WorkingHours() with self.assertRaises(AttributeError) as cm: wh.yearly_working_days = 260.1 self.assertEqual(str(cm.exception), "can't set attribute")