[tests] skip prettyprint tests when NLTK is not available
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Thu, 20 Nov 2014 11:25:22 +0100
changeset 480 e096e8f997fa
parent 479 b15f734f33e1
child 481 92422ce60b21
[tests] skip prettyprint tests when NLTK is not available
test/test_dataio.py
--- a/test/test_dataio.py	Fri Aug 01 14:14:42 2014 +0200
+++ b/test/test_dataio.py	Thu Nov 20 11:25:22 2014 +0100
@@ -30,6 +30,7 @@
                                 sparqlquery, sparqljson, _sparqlexecute,
                                 rqlquery, parsefile,
                                 autocast, split_file)
+from nazca.utils.tokenizer import NLTK_AVAILABLE
 from nazca.ner import NerProcess
 from nazca.ner.sources import NerSourceLexicon
 
@@ -70,6 +71,7 @@
             self.skipTest('Lxml version to old for ValidXHTMLPrettyPrint')
         self.assertFalse(ValidXHTMLPrettyPrint().is_valid(u'<p><div>coucou</div></p>'))
 
+    @unittest.skipUnless(NLTK_AVAILABLE, 'nltk is not available')
     def test_prettyprint(self):
         text = 'Hello everyone, this is   me speaking. And me.'
         source = NerSourceLexicon({'everyone': 'http://example.com/everyone',
@@ -81,6 +83,7 @@
                                 u'this is   <a href="http://example.com/me">me</a> speaking. '
                                 u'And <a href="http://example.com/me">me</a>.'))
 
+    @unittest.skipUnless(NLTK_AVAILABLE, 'nltk is not available')
     def test_prettyprint_class(self):
         text = 'Hello everyone, this is   me speaking. And me.'
         source = NerSourceLexicon({'everyone': 'http://example.com/everyone',