[英]Running Xvfb from tox
I have some code that uses gtk
so unless there is an active DISPLAY
, the code raises an RuntimeError: could not open display
… This happens when I run tox
. 我有一些使用
gtk
代码,因此除非有活动的DISPLAY
,否则代码会引发RuntimeError: could not open display
…这是在我运行tox
时发生的。
Is there a way to run a Xvfb
server from within tox? 有没有办法在
Xvfb
内部运行Xvfb
服务器?
I did try adding 我确实尝试添加
/usr/bin/Xvfb :99 -screen 0 1280x1024x24 &
to the commands section but got an InvocationError
due to the &
. 到命令部分,但由于
&
导致了InvocationError
。 Without it, the command never returns and thus blocks. 没有它,该命令将永远不会返回并因此阻塞。
Use xvfb-run
like so: 像这样使用
xvfb-run
:
xvfb-run tox -v --recreate
This is easily done in Jenkins Pipefiles… 这可以在Jenkins Pipefiles中轻松完成...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.