def test_width_too_small_for_placeholder(self): shorten("x" * 20, width=8, placeholder="(......)") with self.assertRaises(ValueError): shorten("x" * 20, width=8, placeholder="(.......)")