summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRémi Cardona <remi.cardona@free.fr>2014-07-19 19:55:35 +0200
committerRémi Cardona <remi.cardona@free.fr>2014-07-19 19:55:35 +0200
commit3c40166fbbd94702e4ffdca56079b82bb912df7d (patch)
treeb4bd62756506b58450c38dc5a464ad40e759ddd3 /test
parent3decce68245367a2eb5ce2bb3b98087f33ba5546 (diff)
downloadlogilab-common-3c40166fbbd94702e4ffdca56079b82bb912df7d.tar.gz
[py3k] Use metaclasses using six.add_metaclass
Diffstat (limited to 'test')
-rw-r--r--test/unittest_deprecation.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/test/unittest_deprecation.py b/test/unittest_deprecation.py
index ad268e8..b0f8a1a 100644
--- a/test/unittest_deprecation.py
+++ b/test/unittest_deprecation.py
@@ -19,6 +19,8 @@
import warnings
+from six import add_metaclass
+
from logilab.common.testlib import TestCase, unittest_main
from logilab.common import deprecation
@@ -45,8 +47,9 @@ class RawInputTC(TestCase):
return any_func
def test_class_deprecated(self):
- class AnyClass:
- __metaclass__ = deprecation.class_deprecated
+ @add_metaclass(deprecation.class_deprecated)
+ class AnyClass(object):
+ pass
AnyClass()
self.assertEqual(self.messages,
['AnyClass is deprecated'])
@@ -104,8 +107,9 @@ class RawInputTC(TestCase):
def test_class_deprecated_manager(self):
deprecator = deprecation.DeprecationManager("module_name")
deprecator.compatibility('1.3')
- class AnyClass:
- __metaclass__ = deprecator.class_deprecated('1.2')
+ @add_metaclass(deprecator.class_deprecated('1.2'))
+ class AnyClass(object):
+ pass
AnyClass()
self.assertEqual(self.messages,
['[module_name 1.2] AnyClass is deprecated'])