diff --git a/default.nix b/default.nix index 3a47363302f17d5aa412692d43ce90609fb6783d..04193ed1586856a9b21d7403a0cde175071b3344 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,2 @@ -{ pkgs ? import ./nixpkgs.nix { }, hypothesisProfile ? null, collectCoverage ? false, testSuite ? null }: -pkgs.python27Packages.zkapauthorizer.override { inherit hypothesisProfile collectCoverage testSuite; } +{ pkgs ? import ./nixpkgs.nix { }, hypothesisProfile ? null, collectCoverage ? false, testSuite ? null, trialArgs ? [] }: +pkgs.python27Packages.zkapauthorizer.override { inherit hypothesisProfile collectCoverage testSuite trialArgs; } diff --git a/zkapauthorizer.nix b/zkapauthorizer.nix index 462d8fbc23d692ccce570900ef4efc963e59c411..fb54924d419c80e94fcb45b4713d97f4fef5e4aa 100644 --- a/zkapauthorizer.nix +++ b/zkapauthorizer.nix @@ -4,10 +4,12 @@ , hypothesisProfile ? null , collectCoverage ? false , testSuite ? null +, trialArgs ? [] }: let hypothesisProfile' = if hypothesisProfile == null then "default" else hypothesisProfile; testSuite' = if testSuite == null then "_zkapauthorizer" else testSuite; + extraTrialArgs = builtins.concatStringsSep " " trialArgs; in buildPythonPackage rec { version = "0.0"; @@ -39,15 +41,14 @@ buildPythonPackage rec { treq ]; - - checkPhase = '' runHook preCheck + set -x "${pyflakes}/bin/pyflakes" src/_zkapauthorizer ZKAPAUTHORIZER_HYPOTHESIS_PROFILE=${hypothesisProfile'} python -m ${if collectCoverage then "coverage run --branch --source _zkapauthorizer,twisted.plugins.zkapauthorizer --module" else "" - } twisted.trial ${testSuite'} + } twisted.trial ${extraTrialArgs} ${testSuite'} runHook postCheck '';