def test_U(self): from _testcapi import getargs_U obj = 'str' self.assertIs(getargs_U(obj), obj) self.assertRaises(TypeError, getargs_U, b'bytes') self.assertRaises(TypeError, getargs_U, bytearray(b'bytearray')) self.assertRaises(TypeError, getargs_U, None)
def test_U(self): from _testcapi import getargs_U obj = u'unicode' self.assertIs(getargs_U(obj), obj) self.assertRaises(TypeError, getargs_U, 'str') self.assertRaises(TypeError, getargs_U, bytearray('bytearray')) self.assertRaises(TypeError, getargs_U, None) self.assertRaises(TypeError, getargs_U, memoryview(obj)) self.assertRaises(TypeError, getargs_U, buffer(obj))