2 Test the internal getargs.c implementation
4 PyArg_ParseTuple() is defined here.
6 The test here is not intended to test all of the module, just the
7 single case that failed between 2.1 and 2.2a2.
10 # marshal.loads() uses PyArg_ParseTuple(args, "s#:loads")
11 # The s code will cause a Unicode conversion to occur. This test
12 # verify that the error is propagated properly from the C code back to
17 from test
import test_support
19 class GetArgsTest(unittest
.TestCase
):
20 # If the encoding succeeds using the current default encoding,
21 # this test will fail because it does not test the right part of the
22 # PyArg_ParseTuple() implementation.
23 def test_with_marshal(self
):
24 arg
= unicode(r
'\222', 'unicode-escape')
25 self
.assertRaises(UnicodeError, marshal
.loads
, arg
)
28 test_support
.run_unittest(GetArgsTest
)
30 if __name__
== '__main__':