2020-01-12 19:52:40 +00:00
|
|
|
testArgs:
|
|
|
|
|
|
|
|
let
|
2020-05-04 09:53:19 +00:00
|
|
|
pkgs = import <nixpkgs> { config = {}; overlays = []; };
|
2020-01-12 19:52:40 +00:00
|
|
|
|
2020-05-04 09:53:19 +00:00
|
|
|
test = (import "${pkgs.path}/nixos/tests/make-test-python.nix") testArgs;
|
2020-01-12 19:52:40 +00:00
|
|
|
|
|
|
|
fixedTest = { system ? builtins.currentSystem, ... }@args:
|
|
|
|
let
|
|
|
|
pkgsFixed = pkgs // {
|
2020-02-27 00:28:20 +00:00
|
|
|
# Fix the black Python code formatter that's used in the test to allow the test
|
|
|
|
# script to have longer lines. The default width of 88 chars is too restrictive for
|
|
|
|
# our script.
|
2020-01-12 19:52:40 +00:00
|
|
|
python3Packages = pkgs.python3Packages // {
|
|
|
|
black = pkgs.writeScriptBin "black" ''
|
|
|
|
fileToCheck=''${@:$#}
|
|
|
|
[[ $fileToCheck = *test-script ]] && extraArgs='--line-length 100'
|
|
|
|
exec ${pkgs.python3Packages.black}/bin/black $extraArgs "$@"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
test (args // { pkgs = pkgsFixed; });
|
|
|
|
in
|
|
|
|
fixedTest
|