[Python-Dev] DeprecationWarnings in the regression tests

Tim Peters tim.one@comcast.net
Mon, 15 Apr 2002 20:54:43 -0400


[Guido]
> You don't need to, as long as the filterwarnings() arguments specify
> the current file and the specific error message you're suppressing.

Well, that doesn't work:  the current file appears to be irrelevant for
deprecation warnings, and I'm not sure what "the module" argument should be.
For example, in test___all__.py, this works (trial and error) to suppress
the statcache warning:

warnings.filterwarnings("ignore", ".* statcache .*", DeprecationWarning,
                        'statcache')

But I'm not sure why I'm typing 'statcache' as the last argument.  Is this
meant to be a module basename, or some flavor of file path?

If we don't reset warnings after each test, and the name of the test file is
usually irrelevant, then changing the *order* in which we run the tests may
turn up new warnings (suppressed in the normal order of running the tests
because each filterwarnings call affects every test run after the test that
calls it).