0

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.

Is there a way to run a Xvfb server from within tox?

I did try adding

/usr/bin/Xvfb :99 -screen 0 1280x1024x24 &

to the commands section but got an InvocationError due to the &. Without it, the command never returns and thus blocks.

Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156

1 Answers1

2

Use xvfb-run like so:

xvfb-run tox -v --recreate

This is easily done in Jenkins Pipefiles…

Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156