Use the warnings module to print warnings.

Ignore warnings in one known spot in the tests.
This keeps the test output clean.