diff --git a/modules/biplan/test.py b/modules/biplan/test.py index 0b397d8b..8c450714 100644 --- a/modules/biplan/test.py +++ b/modules/biplan/test.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from nose.plugins.skip import SkipTest -from weboob.tools.test import BackendTest from datetime import datetime +from weboob.tools.test import BackendTest, SkipTest + class BiplanTest(BackendTest): BACKEND = 'biplan' diff --git a/modules/feedly/test.py b/modules/feedly/test.py index a50dda85..1e81f748 100644 --- a/modules/feedly/test.py +++ b/modules/feedly/test.py @@ -17,8 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from nose.plugins.skip import SkipTest -from weboob.tools.test import BackendTest +from weboob.tools.test import BackendTest, SkipTest class FeedlyTest(BackendTest): diff --git a/modules/grooveshark/test.py b/modules/grooveshark/test.py index 4f3927ed..2809f8ff 100644 --- a/modules/grooveshark/test.py +++ b/modules/grooveshark/test.py @@ -17,9 +17,8 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from nose.plugins.skip import SkipTest -from weboob.tools.test import BackendTest from weboob.capabilities.audio import BaseAudio +from weboob.tools.test import BackendTest, SkipTest class GroovesharkTest(BackendTest): diff --git a/modules/hybride/test.py b/modules/hybride/test.py index 919b2f88..d453b5da 100644 --- a/modules/hybride/test.py +++ b/modules/hybride/test.py @@ -17,10 +17,10 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from nose.plugins.skip import SkipTest -from weboob.tools.test import BackendTest from datetime import datetime +from weboob.tools.test import BackendTest, SkipTest + class HybrideTest(BackendTest): BACKEND = 'hybride' diff --git a/modules/pastebin/test.py b/modules/pastebin/test.py index 76d1f743..a686829e 100644 --- a/modules/pastebin/test.py +++ b/modules/pastebin/test.py @@ -17,11 +17,9 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from nose.plugins.skip import SkipTest - from weboob.capabilities.base import NotLoaded from weboob.capabilities.paste import PasteNotFound -from weboob.tools.test import BackendTest +from weboob.tools.test import BackendTest, SkipTest from .browser import LimitExceeded diff --git a/modules/twitter/test.py b/modules/twitter/test.py index abbf2bab..748d558a 100644 --- a/modules/twitter/test.py +++ b/modules/twitter/test.py @@ -18,9 +18,9 @@ # along with weboob. If not, see . import itertools -from nose.plugins.skip import SkipTest -from weboob.tools.test import BackendTest + from weboob.capabilities.base import BaseObject +from weboob.tools.test import BackendTest, SkipTest class TwitterTest(BackendTest): diff --git a/weboob/tools/test.py b/weboob/tools/test.py index a9f2c3cd..d54eeb3c 100644 --- a/weboob/tools/test.py +++ b/weboob/tools/test.py @@ -17,14 +17,20 @@ # You should have received a copy of the GNU Affero General Public License # along with weboob. If not, see . -from unittest import TestCase from random import choice +from unittest import TestCase -from nose.plugins.skip import SkipTest from weboob.core import Weboob +# This is what nose does for Python 2.6 and lower compatibility +# We do the same so nose becomes optional +try: + from unittest.case import SkipTest +except: + from nose.plugins.skip import SkipTest -__all__ = ['BackendTest'] + +__all__ = ['BackendTest', 'SkipTest'] class BackendTest(TestCase):