Browse Source

fixes

changes/49/376949/1
Corey Goldberg 8 years ago
parent
commit
f5b14ccdb2
  1. 7
      xvfbwrapper/test_xvfb.py
  2. 3
      xvfbwrapper/xvfbwrapper.py

7
xvfbwrapper/test_xvfb.py

@ -17,6 +17,13 @@ import pep8
class TestXvfb(unittest.TestCase):
def setUp(self):
sys.stdout = sys.__stdout__
self.addCleanup(self.restore_stdout)
def restore_stdout(self):
sys.stdout = sys.__stdout__
def test_start(self):
xvfb = Xvfb()
self.addCleanup(xvfb.stop)

3
xvfbwrapper/xvfbwrapper.py

@ -45,11 +45,12 @@ class Xvfb:
stdout=open(os.devnull),
stderr=open(os.devnull),
)
time.sleep(0.1) # give Xvfb time to start
time.sleep(0.2) # give Xvfb time to start
ret_code = self.proc.poll()
if ret_code is None:
self._redirect_display(self.vdisplay_num)
else:
self._redirect_display(self.old_display_num)
self.proc = None
print('Error: Xvfb did not start')

Loading…
Cancel
Save