This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author SylvainDe
Recipients SylvainDe, serhiy.storchaka
Date 2017-06-08.10:01:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496916103.64.0.0986195266158.issue30592@psf.upfronthosting.co.za>
In-reply-to
Content
As I was trying to test coverage for a few places where the same error was built, I have discovered another issue where the error message is very misleading:

 AssertionError: "^index\(\) takes no keyword arguments$" does not match "index() takes at least 1 argument (0 given)"
 def test_varargs4_kw(self):
     msg = r"^index\(\) takes no keyword arguments$"
     self.assertRaisesRegex(TypeError, msg, [].index, x=2)


Should I open another ticket to track this ?



Anyway, so far, I have reached the following conclusion regarding the test coverage:

Objects/call.c:551:                 "%.200s() takes no keyword arguments" => TESTED
(In _PyMethodDef_RawFastCallDict)

Objects/call.c:690:                 "%.200s() takes no keyword arguments" => Not tested
(In _PyMethodDef_RawFastCallKeywords)

Objects/call.c:737:            PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments" => Not tested
(In cfunction_call_varargs)


Python/getargs.c:2508:    PyErr_Format(PyExc_TypeError, "%.200s takes no keyword arguments" => TESTED (Now)
(In _PyArg_NoKeywords)

Python/getargs.c:2525:    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments" => Not tested
(In _PyArg_NoStackKeywords)


Any suggestion regarding how to test what is not tested is more than welcome.
History
Date User Action Args
2017-06-08 10:01:43SylvainDesetrecipients: + SylvainDe, serhiy.storchaka
2017-06-08 10:01:43SylvainDesetmessageid: <1496916103.64.0.0986195266158.issue30592@psf.upfronthosting.co.za>
2017-06-08 10:01:43SylvainDelinkissue30592 messages
2017-06-08 10:01:42SylvainDecreate