How to use the pyvirtualdisplay.xvfb.XvfbDisplay function in PyVirtualDisplay

To help you get started, we’ve selected a few PyVirtualDisplay examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_is_started():
    #     d = Display()
    #     assert not d._is_started
    #     d.start()
    #     assert d._is_started
    #     d.stop()
    #     assert d._is_started

    # with Display() as d:
    #     assert d._is_started
    # assert d._is_started

    with XvfbDisplay() as d:
        assert d._is_started
    assert d._is_started

    with Display():
        with XephyrDisplay() as d:
            assert d._is_started
        assert d._is_started
github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_repr_xvfb():
    display = Display()
    print(repr(display))

    display = Display(visible=False)
    print(repr(display))

    display = Display(backend="xvfb")
    print(repr(display))

    display = XvfbDisplay()
    print(repr(display))
github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_display():
    d = Display()
    assert d.display is None
    d.start()
    assert d.display >= 0

    d = XvfbDisplay()
    assert d.display is None
    d.start()
    assert d.display >= 0
github ponty / PyVirtualDisplay / tests / test_core.py View on Github external
def test_pid():
    with Display() as d:
        assert d.pid > 0
    with XvfbDisplay() as d:
        assert d.pid > 0