質問

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?

役に立ちましたか?

解決

use the python warnings filter:

import warnings
warnings.simplefilter("error")
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top