The current implementation starts the browser in headed mode automatically, if pytest is invoked from VS Code's debugger.
|
elif VSCODE_PYTHON_EXTENSION_ID in sys.argv[0] and _is_debugger_attached(): |
|
# When the VSCode debugger is attached, then launch the browser headed by default |
|
launch_options["headless"] = False |
While I get the idea behind this, it does not take remote development on a headless server into account. If $DISPLAY is not set, the test run naturally fails and leaves the user wondering why this happens because he did not provide --headed (e.g. in VS Code's python.testing.pytestArgs configuration). IMHO, the implementation should be changed to check for $DISPLAY at least.