ponty / PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
BSD 2-Clause "Simplified" License
697 stars 78 forks source link

Versions 1.1 causes error with pytest_xvfb #51

Closed djhoese closed 4 years ago

djhoese commented 4 years ago

This might be an incompatibility between pytest_xvfb and pyvirtualdisplay 1.0+, but my travis CI jobs have started failing with the below exception. The full travis log is here.

  File "/home/travis/miniconda/envs/test/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/miniconda/envs/test/lib/python3.7/site-packages/pytest_xvfb.py", line 99, in pytest_unconfigure
    config.xvfb.stop()
  File "/home/travis/miniconda/envs/test/lib/python3.7/site-packages/pytest_xvfb.py", line 61, in stop
    self._virtual_display.stop()
  File "/home/travis/miniconda/envs/test/lib/python3.7/site-packages/pyvirtualdisplay/display.py", line 76, in stop
    self._obj.stop()
  File "/home/travis/miniconda/envs/test/lib/python3.7/site-packages/pyvirtualdisplay/abstractdisplay.py", line 313, in stop
    raise XStartError("stop() is called before start().")
pyvirtualdisplay.abstractdisplay.XStartError: stop() is called before start().

For now I can probably limit the version of pyvirtualdisplay, but wanted to check this was expected.

The-Compiler commented 4 years ago

The actual error is this:

INTERNALERROR>   File "/home/travis/miniconda/envs/test/lib/python3.7/site-packages/pytest_xvfb.py", line 46, in start
INTERNALERROR>     self._virtual_display.cmd.extend(self.args)
INTERNALERROR> AttributeError: 'Display' object has no attribute 'cmd'

which is already tracked in https://github.com/The-Compiler/pytest-xvfb/issues/22 - despite failing to start, pytest-xvfb calls .stop(), so PyVirtualDisplay's exception here does make sense.

djhoese commented 4 years ago

Sounds good. Thanks.