summaryrefslogtreecommitdiff
path: root/src/zope/component/tests/test__declaration.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/zope/component/tests/test__declaration.py')
-rw-r--r--src/zope/component/tests/test__declaration.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/zope/component/tests/test__declaration.py b/src/zope/component/tests/test__declaration.py
index 470cab0..1db841d 100644
--- a/src/zope/component/tests/test__declaration.py
+++ b/src/zope/component/tests/test__declaration.py
@@ -131,13 +131,9 @@ class Test_adapts(unittest.TestCase):
])
with warnings.catch_warnings(record=True) as log:
warnings.resetwarnings()
- try:
+ with self.assertRaises(TypeError):
exec(CODE, globs, locs)
- except TypeError:
- if not PYTHON3:
- self.assertEqual(len(log), 0) # no longer warn
- else:
- self.fail("Didn't raise TypeError")
+ self.assertEqual(len(log), 0) # no longer warn
def test_called_once_from_class(self):
from zope.component._declaration import adapts