Fix unit test execution in CI.
This switches to using `python -m pytest`, which causes the current directory to be added to the python path.
This commit is contained in:
parent
aba66a51b5
commit
d7f6081cd6
1 changed files with 3 additions and 2 deletions
|
@ -103,7 +103,6 @@
|
||||||
# busybox does).
|
# busybox does).
|
||||||
++ pkgs.lib.optionals (stdenv.isDarwin) [
|
++ pkgs.lib.optionals (stdenv.isDarwin) [
|
||||||
coreutils
|
coreutils
|
||||||
(pkgs.runCommand "bin-sh" {} "mkdir -p $out/bin && ln -s ${pkgs.bash}/bin/bash $out/bin/sh")
|
|
||||||
])}"
|
])}"
|
||||||
|
|
||||||
export PYPI_DATA=${inp.pypi-deps-db}
|
export PYPI_DATA=${inp.pypi-deps-db}
|
||||||
|
@ -112,8 +111,10 @@
|
||||||
providers = { _default = [ "conda/main" "conda/r" "conda/conda-forge"]; };
|
providers = { _default = [ "conda/main" "conda/r" "conda/conda-forge"]; };
|
||||||
}).condaChannelsJson}
|
}).condaChannelsJson}
|
||||||
|
|
||||||
|
# Use "python -m pytest" to add current directory to python path.
|
||||||
|
# This ensures that mach_nix is importable.
|
||||||
echo "executing unit tests"
|
echo "executing unit tests"
|
||||||
pytest -n $(nproc) -x ${./.}
|
python -m pytest -n ''${WORKERS:-$(nproc)} -x ${./.}
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue