Reputation: 1556
I'm using Pyramid and SQLAlchemy and I have a bunch of tests. From time to time, I notice SAWarnings being issued while tests run. I hunt them down and make them go away.
The most common SAWarning I see is:
......eggs/SQLAlchemy-0.9.3-py2.7.egg/sqlalchemy/engine/default.py:562: SAWarning: Unicode type received non-unicode bind param value.
Now, I'd like my test suite to fail immediately after a SAWarning is found. How do I do this?
Upvotes: 2
Views: 410
Reputation: 75117
use the python warnings filter:
import warnings
warnings.simplefilter("error")
Upvotes: 3