mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-05 21:24:45 +00:00
Only run GUI test when DISPLAY variable is set.
This commit is contained in:
parent
34d5b01e4c
commit
ec2806588f
3 changed files with 10 additions and 2 deletions
|
|
@ -1,2 +1 @@
|
|||
- Only run GUI tests when X server is available (ie. DISPLAY is set)
|
||||
- Port to Python 3.x (will not happen anytime soon though)
|
||||
|
|
|
|||
|
|
@ -183,6 +183,14 @@ def has_pyqt ():
|
|||
need_pyqt = _need_func(has_pyqt, "PyQT")
|
||||
|
||||
|
||||
@memoized
|
||||
def has_x11 ():
|
||||
"""Test if DISPLAY variable is set."""
|
||||
return os.getenv('DISPLAY') is not None
|
||||
|
||||
need_x11 = _need_func(has_x11, 'X11')
|
||||
|
||||
|
||||
@contextmanager
|
||||
def _limit_time (seconds):
|
||||
"""Raises LinkCheckerInterrupt if given number of seconds have passed."""
|
||||
|
|
|
|||
|
|
@ -16,13 +16,14 @@
|
|||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
import unittest
|
||||
import sys
|
||||
from tests import need_pyqt
|
||||
from tests import need_pyqt, need_x11
|
||||
|
||||
|
||||
class TestGui (unittest.TestCase):
|
||||
"""Test OMT GUI client."""
|
||||
|
||||
@need_pyqt
|
||||
@need_x11
|
||||
def test_gui (self):
|
||||
from PyQt4 import QtCore, QtGui, QtTest
|
||||
from linkcheck.gui import LinkCheckerMain
|
||||
|
|
|
|||
Loading…
Reference in a new issue