Re: [sqlalchemy] Turning SAWarnings into exceptions

2016-09-15 Thread Michal Petrucha
On Thu, Sep 15, 2016 at 03:09:44PM +0100, Simon King wrote: > According to https://docs.python.org/2/using/cmdline.html#cmdoption-W, > the full form of -W (and PYTHONWARNINGS) is: > > action:message:category:module:line > > Empty fields are ignored, and unused trailing fields can be left

Re: [sqlalchemy] Turning SAWarnings into exceptions

2016-09-15 Thread Simon King
OK, so it ought to be: error::sqlalchemy.exc.SAWarning ...instead, but that doesn't work because of https://bugs.python.org/issue22543, so you need to do it in code. I have this in my top-level py.test conftest.py: @pytest.fixture(scope='session', autouse=True) def sqlalchemywarnings():

Re: [sqlalchemy] Turning SAWarnings into exceptions

2016-09-15 Thread Simon King
According to https://docs.python.org/2/using/cmdline.html#cmdoption-W, the full form of -W (and PYTHONWARNINGS) is: action:message:category:module:line Empty fields are ignored, and unused trailing fields can be left out, so maybe "error::SAWarning" would work? Simon On Thu, Sep 15, 2016

Re: [sqlalchemy] Turning SAWarnings into exceptions

2016-09-15 Thread Chris Withers
Right, but then a bunch of other errors (ImportWarning?!, DeprecationWarning, etc) stop execution even reaching the code which might be causing the SAWarning. It's really quite disappointing that Python's warning mechanisms don't report a full traceback... On 15/09/2016 13:43, Mike Bayer

Re: [sqlalchemy] Turning SAWarnings into exceptions

2016-09-15 Thread Mike Bayer
import warnings warnings.simplefilter("error") On 09/15/2016 08:07 AM, Chris Withers wrote: Hi All, How can I turn SAWarnings into exceptions? I'm struggling with what to put into the PYTHONWARNINGS environment variable :-S cheers, Chris -- You received this message because you are

[sqlalchemy] Turning SAWarnings into exceptions

2016-09-15 Thread Chris Withers
Hi All, How can I turn SAWarnings into exceptions? I'm struggling with what to put into the PYTHONWARNINGS environment variable :-S cheers, Chris -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop