def test_duplicate_error(self): with self.assertRaisesRegexp( Duplicate.Error, r'Duplicate entry encountered for path foo'): raise Duplicate.Error('foo')
def test_duplicate_error(self): with self.assertRaisesRegex( Duplicate.Error, r"Duplicate entry encountered for path foo"): raise Duplicate.Error("foo")