MCPcopy Create free account
hub / github.com/dot-agent/nextpy / xvfb

Function xvfb

integration/conftest.py:18–36  ·  view source on GitHub ↗

Create virtual X display. This function is a no-op unless GITHUB_ACTIONS is set in the environment. Yields: the pyvirtualdisplay object that the browser will be open on

()

Source from the content-addressed store, hash-verified

16
17@pytest.fixture(scope="session", autouse=True)
18def xvfb():
19 """Create virtual X display.
20
21 This function is a no-op unless GITHUB_ACTIONS is set in the environment.
22
23 Yields:
24 the pyvirtualdisplay object that the browser will be open on
25 """
26 if os.environ.get("GITHUB_ACTIONS"):
27 from pyvirtualdisplay.smartdisplay import ( # pyright: ignore [reportMissingImports]
28 SmartDisplay,
29 )
30
31 global DISPLAY
32 with SmartDisplay(visible=0, size=XVFB_DIMENSIONS) as DISPLAY:
33 yield DISPLAY
34 DISPLAY = None
35 else:
36 yield None
37
38
39def pytest_exception_interact(node, call, report):

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected