<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 7:26 AM, Sean Dague <span dir="ltr"><<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On 12/10/2015 01:56 AM, Joshua Harlow wrote:<br>
> Shouldn't be to hard (although it's probably not on each oslo project,<br>
> but on the consumers projects).<br>
><br>
> The warnings module can turn warnings into raised exceptions with a<br>
> simple command line switch btw...<br>
><br>
> For example:<br>
><br>
> $ python -Wonce<br>
> Python 2.7.6 (default, Jun 22 2015, 17:58:13)<br>
> [GCC 4.8.2] on linux2<br>
> Type "help", "copyright", "credits" or "license" for more information.<br>
>>>> import warnings<br>
>>>> warnings.warn("I am not supposed to be used", DeprecationWarning)<br>
> __main__:1: DeprecationWarning: I am not supposed to be used<br>
><br>
> $ python -Werror<br>
> Python 2.7.6 (default, Jun 22 2015, 17:58:13)<br>
> [GCC 4.8.2] on linux2<br>
> Type "help", "copyright", "credits" or "license" for more information.<br>
>>>> import warnings<br>
>>>> warnings.warn("I am not supposed to be used", DeprecationWarning)<br>
> Traceback (most recent call last):<br>
>   File "<stdin>", line 1, in <module><br>
> DeprecationWarning: I am not supposed to be used<br>
><br>
> <a href="https://docs.python.org/2/library/warnings.html#the-warnings-filter" rel="noreferrer" target="_blank">https://docs.python.org/2/library/warnings.html#the-warnings-filter</a><br>
><br>
> Turn that CLI switch from off to on and I'm pretty sure usage of<br>
> deprecated things will become pretty evident real quick ;)<br>
<br>
</div></div>It needs to be more targetted than that. There is a long standing<br>
warning between paste and pkg_resources that would hard stop everyone.<br>
<br>
But, yes, the idea of being able to run unit tests with fatal<br>
deprecations of oslo easily is what I think would be useful.<br>
<span class=""><font color="#888888"><br>
        -Sean<br>
<br></font></span></blockquote><div><br></div><div>In keystone we set a warnings filter for the unit tests so that if keystone calls any deprecated function it'll raise[1]. So when the oslo timeutils functions were deprecated it broke keystone gate and we fixed it. It would be nicer to have a non-voting gate job to serve as a warning instead, but it's only happened a couple of times where this caused keystone to be blocked for the day that it took to get the fix in. Anyways, it would be easy enough for us to have this enabled/disabled via an environment variable and create a tox job.<br><br></div><div>If we had a non-voting warning job it could also run oslo libs from master rather than released.<br></div><div><br>[1] <a href="http://git.openstack.org/cgit/openstack/keystone/tree/keystone/tests/unit/core.py?id=4f8c4a7a10d85080d6db9b30ae1759d45a38a32c#n460">http://git.openstack.org/cgit/openstack/keystone/tree/keystone/tests/unit/core.py?id=4f8c4a7a10d85080d6db9b30ae1759d45a38a32c#n460</a><br></div><div><br></div><div>- Brant<br></div><br></div></div></div>