예제 #1
0
 def test_fastcall(self):
     for func, args, expected in self.CALLS_POSARGS:
         with self.subTest(func=func, args=args):
             result = _testcapi.pyobject_fastcall(func, args)
             self.check_result(result, expected)
             if not args:
                 result = _testcapi.pyobject_fastcall(func, None)
                 self.check_result(result, expected)
예제 #2
0
    def test_fastcall(self):
        # Test _PyObject_FastCall()

        for func, args, expected in self.CALLS_POSARGS:
            with self.subTest(func=func, args=args):
                result = _testcapi.pyobject_fastcall(func, args)
                self.check_result(result, expected)

                if not args:
                    # args=NULL, nargs=0
                    result = _testcapi.pyobject_fastcall(func, None)
                    self.check_result(result, expected)