Skip to content

Commit

Permalink
python3Packages.pywebview: build fix for tests (#353833)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atemu authored Nov 11, 2024
2 parents 5b27ef3 + bdfa0f0 commit f475d75
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions pkgs/development/python-modules/pywebview/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,17 @@ buildPythonPackage rec {
];

checkPhase = ''
# Cannot create directory /homeless-shelter/.... Error: FILE_ERROR_ACCESS_DENIED
export HOME=$TMPDIR
# QStandardPaths: XDG_RUNTIME_DIR not set
export XDG_RUNTIME_DIR=$HOME/xdg-runtime-dir
# a Qt wrapper is required to run the Qt backend
# since the upstream script does not have a way to disable tests individually pytest is used directly instead
makeQtWrapper "$(command -v pytest)" tests/run.sh \
--set PYWEBVIEW_LOG debug \
--add-flags "--deselect tests/test_js_api.py::test_concurrent"
pushd tests
substituteInPlace run.sh \
--replace "PYTHONPATH=.." "PYTHONPATH=$PYTHONPATH" \
--replace "pywebviewtest test_js_api.py::test_concurrent ''${PYTEST_OPTIONS}" "# skip flaky test_js_api.py::test_concurrent"
patchShebangs run.sh
wrapQtApp run.sh
xvfb-run -s '-screen 0 800x600x24' ./run.sh
popd
# HOME and XDG directories are required for the tests
env \
HOME=$TMPDIR \
XDG_RUNTIME_DIR=$TMPDIR/xdg-runtime-dir \
xvfb-run -s '-screen 0 800x600x24' tests/run.sh
'';

pythonImportsCheck = [ "webview" ];
Expand Down

0 comments on commit f475d75

Please sign in to comment.