diff --git a/src/ZODB/tests/testConnection.py b/src/ZODB/tests/testConnection.py index 9205962afc9be3ee5f7e9fff26bc2354edcfba55..c71816a57147b356c297faefa9f2262b0bda4e58 100644 --- a/src/ZODB/tests/testConnection.py +++ b/src/ZODB/tests/testConnection.py @@ -407,6 +407,13 @@ class UserMethodTests(unittest.TestCase): >>> hook = WarningsHook() >>> hook.install() + More problems in case this test is run more than once: fool the + warnings module into delivering the warnings despite that they've + been seen before. + + >>> import warnings + >>> warnings.filterwarnings("always", category=DeprecationWarning) + >>> r._p_activate() >>> cn.cacheMinimize(12) >>> r._p_state @@ -450,6 +457,10 @@ class UserMethodTests(unittest.TestCase): >>> hook.uninstall() + Obscure: There is no API call for removing the filter we added, but + filters appears to be a public variable. + + >>> del warnings.filters[0] """ class InvalidationTests(unittest.TestCase): diff --git a/src/ZODB/tests/warnhook.py b/src/ZODB/tests/warnhook.py index a09002cb0410af21ff98ac0ef4d9662964d09b68..87f32fd261f84d328066339f8c4bbb088a2920c4 100644 --- a/src/ZODB/tests/warnhook.py +++ b/src/ZODB/tests/warnhook.py @@ -20,7 +20,7 @@ class WarningsHook: application code, allowing the application to customize the way it handles warnings. - This hook captures the unformatted warning information and stored + This hook captures the unformatted warning information and stores it in a list. A test can inspect this list after the test is over. Issues: