changeset 2015:181fad10920a

use pytest.importorskip
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 02 Mar 2013 17:31:21 +0100
parents a49a5a0964d7
children 3e8c910f66f8
files MoinMoin/converter/_tests/test_docbook_in.py MoinMoin/converter/_tests/test_docbook_out.py MoinMoin/converter/_tests/test_html_in.py MoinMoin/converter/_tests/test_html_in_out.py MoinMoin/converter/_tests/test_html_out.py
diffstat 5 files changed, 8 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/converter/_tests/test_docbook_in.py	Mon Feb 18 01:01:24 2013 +0100
+++ b/MoinMoin/converter/_tests/test_docbook_in.py	Sat Mar 02 17:31:21 2013 +0100
@@ -12,10 +12,7 @@
 
 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 *
 
--- a/MoinMoin/converter/_tests/test_docbook_out.py	Mon Feb 18 01:01:24 2013 +0100
+++ b/MoinMoin/converter/_tests/test_docbook_out.py	Sat Mar 02 17:31:21 2013 +0100
@@ -11,10 +11,7 @@
 
 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 *
 
--- a/MoinMoin/converter/_tests/test_html_in.py	Mon Feb 18 01:01:24 2013 +0100
+++ b/MoinMoin/converter/_tests/test_html_in.py	Sat Mar 02 17:31:21 2013 +0100
@@ -10,10 +10,8 @@
 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 *
 
--- a/MoinMoin/converter/_tests/test_html_in_out.py	Mon Feb 18 01:01:24 2013 +0100
+++ b/MoinMoin/converter/_tests/test_html_in_out.py	Sat Mar 02 17:31:21 2013 +0100
@@ -13,10 +13,8 @@
 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__)
--- a/MoinMoin/converter/_tests/test_html_out.py	Mon Feb 18 01:01:24 2013 +0100
+++ b/MoinMoin/converter/_tests/test_html_out.py	Sat Mar 02 17:31:21 2013 +0100
@@ -11,10 +11,8 @@
 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 *