ctp.py: use builtin warnings module

This allows to also test for warnings.
ctp.py: fixed bug w/ warnings and line numbers

Fixed a bug where the script would display a warning even
if ground and/or vin was specified.

Also removed an extra 'line_num + 1' that would cause warnings
and errors to look like they happened a line after the actual
line.
test_ctp.py: clean up the test cases

This makes them easier to read through.
test_ctp.py: add tests for warnings