Commits

Thomas Waldmann committed 181fad1

use pytest.importorskip

  • Participants
  • Parent commits a49a5a0

Comments (0)

Files changed (5)

File MoinMoin/converter/_tests/test_docbook_in.py

 
 import pytest
 
-try:
-    from lxml import etree
-except:
-    pytest.skip("lxml module required to run test for docbook_in converter.")
+etree = pytest.importorskip('lxml.etree')
 
 from emeraldtree.tree import *
 

File MoinMoin/converter/_tests/test_docbook_out.py

 
 import pytest
 
-try:
-    from lxml import etree
-except:
-    pytest.skip("lxml module required to run test for docbook_out converter.")
+etree = pytest.importorskip('lxml.etree')
 
 from emeraldtree.tree import *
 

File MoinMoin/converter/_tests/test_html_in.py

 import StringIO
 
 import pytest
-try:
-    from lxml import etree
-except:
-    pytest.skip("lxml module required to run test for html_in converter.")
+
+etree = pytest.importorskip('lxml.etree')
 
 from emeraldtree.tree import *
 

File MoinMoin/converter/_tests/test_html_in_out.py

 import re
 
 import pytest
-try:
-    from lxml import etree
-except:
-    pytest.skip("lxml module required to run test for html_in_out converter.")
+
+etree = pytest.importorskip('lxml.etree')
 
 from MoinMoin import log
 logging = log.getLogger(__name__)

File MoinMoin/converter/_tests/test_html_out.py

 import StringIO
 
 import pytest
-try:
-    from lxml import etree
-except:
-    pytest.skip("lxml module required to run test for html_out converter.")
+
+etree = pytest.importorskip('lxml.etree')
 
 from emeraldtree.tree import *