tests: Don't start Xvfb for unittests-nodisp.
This commit is contained in:
parent
b0f001d3f1
commit
b1b767ed96
@ -109,7 +109,7 @@ def pytest_collection_modifyitems(items):
|
|||||||
item.add_marker('gui')
|
item.add_marker('gui')
|
||||||
if sys.platform == 'linux' and not os.environ.get('DISPLAY', ''):
|
if sys.platform == 'linux' and not os.environ.get('DISPLAY', ''):
|
||||||
if ('CI' in os.environ and
|
if ('CI' in os.environ and
|
||||||
not os.environ.get('QUTE_NO_DISPLAY_OK', '')):
|
not os.environ.get('QUTE_NO_DISPLAY', '')):
|
||||||
raise Exception("No display available on CI!")
|
raise Exception("No display available on CI!")
|
||||||
skip_marker = pytest.mark.skipif(
|
skip_marker = pytest.mark.skipif(
|
||||||
True, reason="No DISPLAY available")
|
True, reason="No DISPLAY available")
|
||||||
@ -374,7 +374,10 @@ def pytest_configure(config):
|
|||||||
if os.environ.get('DISPLAY', None) == '':
|
if os.environ.get('DISPLAY', None) == '':
|
||||||
# xvfbwrapper doesn't handle DISPLAY="" correctly
|
# xvfbwrapper doesn't handle DISPLAY="" correctly
|
||||||
del os.environ['DISPLAY']
|
del os.environ['DISPLAY']
|
||||||
if sys.platform.startswith('linux') and not config.getoption('--no-xvfb'):
|
|
||||||
|
if (sys.platform.startswith('linux') and
|
||||||
|
not config.getoption('--no-xvfb') and
|
||||||
|
'QUTE_NO_DISPLAY' not in os.environ):
|
||||||
assert 'QUTE_BUILDBOT' not in os.environ
|
assert 'QUTE_BUILDBOT' not in os.environ
|
||||||
try:
|
try:
|
||||||
disp = xvfbwrapper.Xvfb(width=800, height=600, colordepth=16)
|
disp = xvfbwrapper.Xvfb(width=800, height=600, colordepth=16)
|
||||||
|
2
tox.ini
2
tox.ini
@ -73,7 +73,7 @@ passenv = {[testenv]passenv}
|
|||||||
deps = {[testenv]deps}
|
deps = {[testenv]deps}
|
||||||
setenv =
|
setenv =
|
||||||
DISPLAY=
|
DISPLAY=
|
||||||
QUTE_NO_DISPLAY_OK=1
|
QUTE_NO_DISPLAY=1
|
||||||
commands =
|
commands =
|
||||||
{envpython} scripts/link_pyqt.py --tox {envdir}
|
{envpython} scripts/link_pyqt.py --tox {envdir}
|
||||||
{envpython} -m py.test --strict -rfEw {posargs:tests}
|
{envpython} -m py.test --strict -rfEw {posargs:tests}
|
||||||
|
Loading…
Reference in New Issue
Block a user