[test] fix skipIf import, currently failing if unittest2 is not there stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Apr 2013 14:37:48 +0200
branchstable
changeset 8909 f46b017db2d9
parent 8908 1eefbe171b59
child 8910 7652c3d46ba3
[test] fix skipIf import, currently failing if unittest2 is not there
test/unittest_uilib.py
--- a/test/unittest_uilib.py	Wed Apr 24 14:36:41 2013 +0200
+++ b/test/unittest_uilib.py	Wed Apr 24 14:37:48 2013 +0200
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -23,7 +23,10 @@
 
 import pkg_resources
 
-from unittest2 import skipIf
+try:
+    from unittest import skipIf
+except ImportError:
+    from unittest2 import skipIf
 
 from logilab.common.testlib import DocTest, TestCase, unittest_main