How to detect an undefined method?

Skip Montanaro skip.montanaro at gmail.com
Sun Mar 27 12:36:01 EDT 2022


> Let's say I have a Python app and have used an undefined method somewhere.
> Let
> us further assume I have not detected it thru my tests.
>
> Is there a way to detect it before deploying the app? pylint doesn't
> notice it.
>

This is maybe not exactly what you're looking for, but writing a test to
exercise that function call (if possible) would be top of my list. Next on
my list would be to use coverage to get a good idea of what code is not
tested. Writing more test cases to reduce the number of uncovered lines
will also make it easier to manually examine the rest of your (untested) code
to find calls to missing functions or methods.

Skip

>


More information about the Python-list mailing list