[pypy-commit] pypy default: skip syslog tests when module not available

mattip noreply at buildbot.pypy.org
Tue Apr 16 19:13:17 CEST 2013


Author: mattip <matti.picus at gmail.com>
Branch: 
Changeset: r63413:41c27a4a7146
Date: 2013-04-16 18:57 +0300
http://bitbucket.org/pypy/pypy/changeset/41c27a4a7146/

Log:	skip syslog tests when module not available

diff --git a/pypy/module/test_lib_pypy/test_ctypes_config_cache.py b/pypy/module/test_lib_pypy/test_ctypes_config_cache.py
--- a/pypy/module/test_lib_pypy/test_ctypes_config_cache.py
+++ b/pypy/module/test_lib_pypy/test_ctypes_config_cache.py
@@ -33,6 +33,10 @@
 
 
 def test_syslog():
+    try:
+        import lib_pypy.syslog
+    except ImportError:
+        py.test.skip('no syslog on this platform')
     d = run('syslog.ctc.py', '_syslog_cache.py')
     assert 'LOG_NOTICE' in d
 
diff --git a/pypy/module/test_lib_pypy/test_syslog.py b/pypy/module/test_lib_pypy/test_syslog.py
--- a/pypy/module/test_lib_pypy/test_syslog.py
+++ b/pypy/module/test_lib_pypy/test_syslog.py
@@ -1,11 +1,15 @@
 from __future__ import absolute_import
+import py
+try:
+    from lib_pypy import syslog
+except ImportError:
+    py.test.skip('no syslog on this platform')
+
 # XXX very minimal test
 
 from lib_pypy.ctypes_config_cache import rebuild
 rebuild.rebuild_one('syslog.ctc.py')
 
-from lib_pypy import syslog
-
 
 def test_syslog():
     assert hasattr(syslog, 'LOG_ALERT')


More information about the pypy-commit mailing list